locked
SQL RRS feed

  • Question

  • User-220722638 posted
    What is wrong with this code? It's not working $sql = ("SELECT  id, title, price, textbooks_id FROM `books`, `textbooks` WHERE books.id= textbooks_id.id  LIMIT 1  "); Nerakar M G: $query = mysql_query($sql) or die (mysql_error());
    Wednesday, October 26, 2011 2:11 PM

All replies

  • User1994126347 posted

    You mean to say no results displayed or an exception is thrown? Your query works fine in SQL. Need more info

    Wednesday, October 26, 2011 3:07 PM
  • User-1412735316 posted

    Instead of textbooks_id.id it will be textbooks.id

    What is wrong with this code? It's not working $sql = ("SELECT  id, title, price, textbooks_id FROM `books`, `textbooks` WHERE books.id= textbooks.id  LIMIT 1  "); Nerakar M G: $query = mysql_query($sql) or die (mysql_error());



    Thursday, January 28, 2021 5:42 PM