This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-01 13:41:39

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Resource #13 error in mysql code?

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)


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#2 2012-11-01 13:45:06

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Resource #13 error in mysql code?

what query are you executing and where from?


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2012-11-01 13:49:49

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: Resource #13 error in mysql code?

I've got one. Using mathematics, what equation will always stuff it up?


Who would win, SOPA or PIPA?

Offline

 

#4 2012-11-01 13:57:38

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: Resource #13 error in mysql code?

This isn't some kind of a game, is it?


6418,

Offline

 

#5 2012-11-01 14:06:59

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Resource #13 error in mysql code?

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#6 2012-11-01 14:15:44

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Resource #13 error in mysql code?

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


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#7 2012-11-01 14:21:17

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: Resource #13 error in mysql code?

Hang on... Is this for serious requests or challenges?


Who would win, SOPA or PIPA?

Offline

 

#8 2012-11-01 14:35:47

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Resource #13 error in mysql code?

MrFlash67 wrote:

Hang on... Is this for serious requests or challenges?

My code is

Code:

<?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");
?>

http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#9 2012-11-01 14:56:06

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Resource #13 error in mysql code?

Well, you have to use mysql_fetch_array().

Offline

 

#10 2012-11-01 15:00:31

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Resource #13 error in mysql code?

scimonster wrote:

Well, you have to use mysql_fetch_array().

Or mysql_fetch_assoc...
In this case, I think you want mysql_fetch_single


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#11 2012-11-01 16:21:44

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Resource #13 error in mysql code?

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.


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#12 2012-11-01 16:52:40

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Resource #13 error in mysql code?

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.

Offline

 

#13 2012-11-01 17:07:33

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Resource #13 error in mysql code?

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  smile


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

Board footer