Jump to content

Get Method


eugene2009

Recommended Posts

What is the proper wat to retrieve the variable in the mysql_query? I am having tons of trouble getting this little code to work. Please help

 

$id = $_GET['id'];
$result = mysql_query("SELECT * FROM comments WHERE id ='$id' ");
$row = mysql_fetch_assoc($result);


echo 'The customers name is, '.$row['name'].' and he made a purchase on, '.$row['date'].'.<BR>' ;

 

Please help me. Thank you

 

Link to comment
https://forums.phpfreaks.com/topic/181943-get-method/
Share on other sites

What is the proper wat to retrieve the variable in the mysql_query? I am having tons of trouble getting this little code to work. Please help

 

$id = $_GET['id'];
$result = mysql_query("SELECT * FROM comments WHERE id =[b]'$id' "[/b]);
$row = mysql_fetch_assoc($result);

echo 'The customers name is, '.$row['name'].' and he made a purchase on, '.$row['date'].'.<BR>' ;

 

Please help me. Thank you

 

 

The code is correct but check WHERE id ='$id' ", erase the space between ' and "

Link to comment
https://forums.phpfreaks.com/topic/181943-get-method/#findComment-959790
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.