Page 3 of 3

Re: Reading from a database

Posted: Sun Jul 26, 2009 4:43 pm
by jackpf
Well, take that last error for example. Surely you could have figured that out? It's saying that the column doesn't exist...

And the one about mysql_fetch_array() not having a valid resource handler...that means that mysql_query() isn't returning a resource handler, so it's probably returning false (you can check with var_dump()). That means your query is failing, so you should debug that.

Just stuff like that. I'm not trying to be mean; I'm just trying to show you how you should go about errors, saving yourself time posting here. Don't get me wrong, I have no problem helping you, otherwise I wouldn't do it, but I't'll be better for you in the long run...

Re: Reading from a database

Posted: Sun Jul 26, 2009 4:48 pm
by Adam_C
thanks for the advice (not sarcastic :)) but for things like the last one fair enough but i dont really know any php and aren't able to understand errors etc :)

is there a site which lists such errors etc ? :)

Re: Reading from a database

Posted: Sun Jul 26, 2009 4:54 pm
by jackpf
Not that I know of...

But tbh, I think PHP and MySQL errors are actually rather generous, as in they're pretty self explanatory.

If you read the error, and think about what it says and what could be causing it, you can usually figure out what's wrong.

They usually give you line references as well, so you know exactly what line is causing the problem. That's possibly the most useful thing ever - especially when you've got scripts several thousand lines long.

Re: Reading from a database

Posted: Sun Jul 26, 2009 4:56 pm
by Adam_C
cool, thanks again :) how did / do you learn so much web script then ? I'm only 15 and want to become a webdesigner or something like that. any tips? :)

Re: Reading from a database

Posted: Sun Jul 26, 2009 4:59 pm
by jackpf
Well, I'm only 16, so.... :P

Pretty cool tbh, because most of the people on forums such as this are like 30, and "professional" web developers, and I'm teaching them stuff...

Idk, I knew a bit of C beforehand, and the two languages are very similiar. To be perfectly honest, I've probably learnt most of what I know from helping people on forums like this.

If someone has a problem that I don't understand, I'll go and research it until i find a solution. In the process I'll probably teach myself something new as well, which I'll update or implement in my own code.

Oh, and read the manual. Seriously. :P

Re: Reading from a database

Posted: Sun Jul 26, 2009 5:07 pm
by Adam_C
wow ! that makes sense too ! :)

btw, what manual ? :)

Re: Reading from a database

Posted: Sun Jul 26, 2009 5:43 pm
by jackpf
The manual for whatever language you're coding in.

php manual
mysql manual

Re: Reading from a database

Posted: Sun Jul 26, 2009 5:45 pm
by Adam_C
thank you very much, i didnt know about these :)

hope to speak to you again :)

Adam

Re: Reading from a database

Posted: Sun Jul 26, 2009 5:46 pm
by Adam_C
by the way, you wouldn't know about javascript would you, is there a way of showing the error like php ?

I am trying to make a validation form :)

Re: Reading from a database

Posted: Mon Jul 27, 2009 5:04 am
by jackpf
I would call myself capable :P

If you download something like firebug, or just use the firefox error console you can see errors.