Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
mysql_result() error.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Jerry" data-source="post: 278924" data-attributes="member: 35321"><p>I recieved this error;</p><p>[CODE]Warning: mysql_result(): supplied argument is not a valid MySQL result resource in *************.php on line 12[/CODE]</p><p>Here's the code;</p><p>[CODE]<?php</p><p>// Create connection</p><p>$con=mysql_connect("HOST","USERNAME","PASSWORD","DBNAME");</p><p></p><p>// Check connection</p><p>if (!$con)</p><p> {</p><p> echo "Failed to connect to MySQL: " . mysql_connect_error();</p><p> }</p><p>?></p><p></p><p><center><li class="active"><center>User(s) Online : <span class="badge"><?php echo mysql_result(mysql_query("SELECT online_now FROM stats;"),0); ?></span> | Total Cloudflare Resolved : <span class="badge"><?php echo mysql_result(mysql_query("SELECT cloudflare_resolved FROM stats;"),0); ?></span> | Total Skype Resolved : <span class="badge"><?php echo mysql_result(mysql_query("SELECT skype_resolved FROM stats;"),0); ?></span> | Online Today : <span class="badge"><?php echo mysql_result(mysql_query("SELECT online_today FROM stats;"),0); ?></span> </center>[/CODE]</p><p><img src="http://i.imgur.com/wflSoos.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Any clues?</p></blockquote><p></p>
[QUOTE="Jerry, post: 278924, member: 35321"] I recieved this error; [CODE]Warning: mysql_result(): supplied argument is not a valid MySQL result resource in *************.php on line 12[/CODE] Here's the code; [CODE]<?php // Create connection $con=mysql_connect("HOST","USERNAME","PASSWORD","DBNAME"); // Check connection if (!$con) { echo "Failed to connect to MySQL: " . mysql_connect_error(); } ?> <center><li class="active"><center>User(s) Online : <span class="badge"><?php echo mysql_result(mysql_query("SELECT online_now FROM stats;"),0); ?></span> | Total Cloudflare Resolved : <span class="badge"><?php echo mysql_result(mysql_query("SELECT cloudflare_resolved FROM stats;"),0); ?></span> | Total Skype Resolved : <span class="badge"><?php echo mysql_result(mysql_query("SELECT skype_resolved FROM stats;"),0); ?></span> | Online Today : <span class="badge"><?php echo mysql_result(mysql_query("SELECT online_today FROM stats;"),0); ?></span> </center>[/CODE] [IMG]http://i.imgur.com/wflSoos.png[/IMG] Any clues? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
mysql_result() error.
Top