redarrow Posted May 12, 2006 Share Posted May 12, 2006 why does this not work nothink happens any idears please cheers.[code]$query="select * from members_picture_uploads where id='$id'"; echo $query;$result=mysql_query($query);if(!mysql_num_rows($result)==1) {echo"sorry only 1 picture per profile please use your update picture link on you members page";exit;}[/code]or[code]$query="select * from members_picture_uploads where id='$id'"; echo $query;$result=mysql_query($query);while($row=mysql_fetch_assoc($result) {if(!$row["userfile_name"]==1) {echo"sorry only 1 picture per profile please use your update picture link on you members page";exit;}}[/code] Quote Link to comment Share on other sites More sharing options...
shoz Posted May 13, 2006 Share Posted May 13, 2006 [quote][code]$query="select * from members_picture_uploads where id='$id'";echo $query;$result=mysql_query($query);if(!mysql_num_rows($result)==1) {echo"sorry only 1 picture per profile please use your update picture link on you members page";exit;}[/code][/quote]If [a href=\"http://www.php.net/manual/en/ini.core.php#ini.register-globals\" target=\"_blank\"]register_globals[/a] is not on and you haven't assigned a value to $id using $_GET['id'] or $_POST['id'] etc, then you'll have to do that.eg:[code]$id = $_GET['id'][/code]To help track down the problem you can add an "or die()" after the mysql_query call.eg:[code]$result = mysql_query($query) or die($query."<br />\n".mysql_error());[/code]If an error is displayed and your not able to figure out the problem, then post it here.Also add the following to the top of your script(s) if you haven't done so already.[code]error_reporting(E_ALL);[/code]You'll see NOTICE errors that aren't usually displayed by default. They tend to help find problems that might otherwise be difficult to find. Quote Link to comment Share on other sites More sharing options...
448191 Posted May 13, 2006 Share Posted May 13, 2006 Seems to me, looking at your script, nothing is SUPPOSED to happen.Only if !mysql_num_rows($result)==1 something extra gets echoed. (Besides the query, which I assume IS being echoed.) Quote Link to comment Share on other sites More sharing options...
redarrow Posted May 13, 2006 Author Share Posted May 13, 2006 [!--quoteo(post=373457:date=May 13 2006, 07:57 AM:name=448191)--][div class=\'quotetop\']QUOTE(448191 @ May 13 2006, 07:57 AM) [snapback]373457[/snapback][/div][div class=\'quotemain\'][!--quotec--]Seems to me, looking at your script, nothing is SUPPOSED to happen.Only if !mysql_num_rows($result)==1 something extra gets echoed. (Besides the query, which I assume IS being echoed.)[/quote][!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--] Quote Link to comment 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.