kernelgpf Posted March 4, 2006 Share Posted March 4, 2006 $riderid=$_GET['riderid'];$query=mysql_query("select * from riders where ridersid='$riderid'")or die(mysql_error());$row=mysql_fetch_array($query);if($_GET['action'] == "levelrider"){if($row[owner] != "$sid"){print "You don't own this rider.";exit;}That's my code. Everything seems to be working right. action=levelrider is in the URL, no error is being printed out, $sid is equalling what it should, but $row[owner] doesn't show up. It's the correct column name, isn't a blank value... Quote Link to comment https://forums.phpfreaks.com/topic/4108-weird-problem-with-fetch_array-not-fetching-everything-seems-fine/ Share on other sites More sharing options...
kenrbnsn Posted March 4, 2006 Share Posted March 4, 2006 Your curly braces aren't balanced:[code]<?php$riderid=$_GET['riderid'];$query=mysql_query("select * from riders where ridersid='$riderid'")or die(mysql_error());$row=mysql_fetch_assoc($query); // changed to getting an associative arrayecho '<pre>'.print_r($row,true).'</pre>'; //debug statement -- see what is being returnedif($_GET['action'] == "levelrider"){ if($row[owner] != $sid){ // don't need the double quotes here print "You don't own this rider."; exit; }} // added this end curly brace.?>[/code]See my comments in the code.Ken Quote Link to comment https://forums.phpfreaks.com/topic/4108-weird-problem-with-fetch_array-not-fetching-everything-seems-fine/#findComment-14274 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.