Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Fatal Error
10-02-2011, 07:08 AM #1
- Join Date
- Sep 2011
- Thanked 0 Times in 0 Posts
Okay so i have a "home page" being populated with data from a database inside a form table. I have added checkboxes to allow the user to check which recipe he/she wants to view. or the user can select (check) more than one recipe and then another page will open and display the data for the recipe or recipes the user (checked)
Here is the code i am using after the user has checked and hit the submit button displaying the data on another page.
<? $db = mysql_connect( "localhost","root", "temp1234"); mysql_select_db( "Peters_restaurantDB"); $id = $_GET['r_name']; $sql = " SELECT id, name, description, preptime, totaltime, rating FROM recipes WHERE id IN (" . implode( ",", $_GET("r_name") ) . "); ";
Fatal error: Function name must be a string in /var/ShoppingList.php on line 21
The line with the "WHERE id IN"
Can someone please tell me what i am doing wrong or leaving out?
10-02-2011, 07:37 AM #2
*PLEASE* don't start a new thread with the SAME CONTENT as an existing one!
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
10-02-2011, 04:07 PM #3
- Join Date
- Mar 2007
- Thanked 2,224 Times in 2,211 Posts
$sql ="SELECT id, name, description, preptime, totaltime, rating
WHERE id IN (" . implode( ",", $_GET["r_name"] ) . "); ";
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)