cc976a Posted August 1, 2009 Share Posted August 1, 2009 Hop someone can help. Recently moved servers and small but fundemental script now not working. It is: $abc = $_POST[$def] ; $ghi = $_POST[$jkl] ; if (($abc == '10') && ($ghi == '10')) { $dosomething = mysql_query("select * from table where place='1' order by id asc"); $dosomething1 = mysql_num_rows($dosomething); } Anyone have any suggestions as to what is not working. Basically no errors received but I have a script further down which says if $dosomething1 is 0 then show 'No Results Found' which is what is being displayed - whereas before the move hundreds of results were appearing. I've checked the database and all is fine there too Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/ Share on other sites More sharing options...
bundyxc Posted August 1, 2009 Share Posted August 1, 2009 Try this: $abc = $_POST[$def] ; $ghi = $_POST[$jkl] ; if (($abc == '10') && ($ghi == '10')) { $dosomething = mysql_query("select * from table where place=\'1\' order by id asc"); $dosomething1 = mysql_num_rows($dosomething); } Looks like you forgot to escape your single-quotes in $dosomething Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888210 Share on other sites More sharing options...
cc976a Posted August 1, 2009 Author Share Posted August 1, 2009 Tried this (as shown above) but same result I'm afraid Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888211 Share on other sites More sharing options...
bundyxc Posted August 1, 2009 Share Posted August 1, 2009 Do you have your error handling turned on? If not, add this to the top of your script: error_reporting(E_ALL); ini_set('display_errors','1'); Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888215 Share on other sites More sharing options...
cc976a Posted August 1, 2009 Author Share Posted August 1, 2009 It is showing: Undefined variable: abc Undefined variable: ghi Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888217 Share on other sites More sharing options...
bundyxc Posted August 1, 2009 Share Posted August 1, 2009 How's about this? <?php $abc = $_POST['def']; $ghi = $_POST['jkl']; if (($abc == '10') && ($ghi == '10')) { $dosomething = mysql_query("select * from table where place=\'1\' order by id asc"); $dosomething1 = mysql_num_rows($dosomething); } ?> Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888220 Share on other sites More sharing options...
cc976a Posted August 1, 2009 Author Share Posted August 1, 2009 You star !!!! Thank you very much. Results showing fine Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888223 Share on other sites More sharing options...
bundyxc Posted August 1, 2009 Share Posted August 1, 2009 You're very welcome. Link to comment https://forums.phpfreaks.com/topic/168379-simple-_post-command-now-not-working/#findComment-888226 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.