varcxx Posted June 17, 2008 Share Posted June 17, 2008 In the script: if ($_GET[id]) { $get_item="select * from works where id = '$id' and view = '1' order by id asc"; $result=mysql_query($get_item, $conn) or die (mysql_error()); } When I send: my_page.php?id=6 $id is not catching the number. This is so weird! It stopped working when I moved my site to a new server running PHP version 4.4.8 My previous server was running 4.4.7 Could this be the cause of this bug? How can I make it work? Link to comment https://forums.phpfreaks.com/topic/110546-not-getting-the-variable/ Share on other sites More sharing options...
dmccabe Posted June 17, 2008 Share Posted June 17, 2008 your not setting $id to anything if ($_GET[id]) { $get_item="select * from works where id = '$id' and view = '1' order by id asc"; $result=mysql_query($get_item, $conn) or die (mysql_error()); } should be: if ($_GET['id']) { $id = $_GET['id']; $get_item="select * from works where id = '$id' and view = '1' order by id asc"; $result=mysql_query($get_item, $conn) or die (mysql_error()); } Link to comment https://forums.phpfreaks.com/topic/110546-not-getting-the-variable/#findComment-567109 Share on other sites More sharing options...
varcxx Posted June 18, 2008 Author Share Posted June 18, 2008 Thank you very much. That makes sense and it works now. What threw me off was that it was working without it before I moved it. Anyway, problem solved. Thanks again. v. Link to comment https://forums.phpfreaks.com/topic/110546-not-getting-the-variable/#findComment-567957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.