Post questions! To start... eh... what do I do when I get Resource #13 error in mysql code.
Last edited by Paddle2See (2012-11-01 14:07:28)
Offline
This isn't some kind of a game, is it?
Offline
WindowsExplorer wrote:
Post questions! To start... eh... what do I do when I get Resource #13 error in mysql code.
Let's keep the topics a bit more specific so that you are more likely to get an answer. I'll rename this for you.
Offline
Paddle2See wrote:
WindowsExplorer wrote:
Post questions! To start... eh... what do I do when I get Resource #13 error in mysql code.
Let's keep the topics a bit more specific so that you are more likely to get an answer. I'll rename this for you.
K
Offline
MrFlash67 wrote:
Hang on... Is this for serious requests or challenges?
My code is
<?php include "connect.php"; $season = mysql_query("SELECT season FROM season"); $season_message = mysql_query("SELECT message FROM season"); $season_background = mysql_query("SELECT background FROM season"); $season_favicon = mysql_query("SELECT favicon FROM season"); $season_color = mysql_query("SELECT color FROM season"); ?>
Offline
Well, you have to use mysql_fetch_array().
Offline
Got "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in (directory) on line 3" when i tried mysql_fetch_array, and some other thingy about not specified function when I tried mysql_fetch_single.
Offline
Well, jvvg makes a good point that fetch_single is more appropriate in this case, but the whole code should be rewritten. Here's a more efficient way:
include "connect.php"; $query = mysql_query("SELECT * FROM season"); $result = mysql_fetch_array($query); $season = $result['season']; $etc = $result['etc'];
To be even more efficient, you could replace the asterisk in the query with the individual columns.
Offline
LS97 wrote:
Well, jvvg makes a good point that fetch_single is more appropriate in this case, but the whole code should be rewritten. Here's a more efficient way:
Code:
include "connect.php"; $query = mysql_query("SELECT * FROM season"); $result = mysql_fetch_array($query); $season = $result['season']; $etc = $result['etc'];To be even more efficient, you could replace the asterisk in the query with the individual columns.
Thanks. I actually had this, just didn't post it. I came up with the exact same solution myself and it works. Thanks
Offline