...

View Full Version : Fatal Error



VickP07
10-02-2011, 07:08 AM
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[]") ) . ");
";



Right now i am getting this error:

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?

Old Pedant
10-02-2011, 07:37 AM
*PLEASE* don't start a new thread with the SAME CONTENT as an existing one!

abduraooft
10-02-2011, 04:07 PM
Try
$sql ="SELECT id, name, description, preptime, totaltime, rating
FROM recipes
WHERE id IN (" . implode( ",", $_GET["r_name"] ) . "); ";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum