Site Not Working 1432
Omg…I have been trying to get my blog up on my site for three days. Nothing works. Either I can't get it to echo anything, I get errors, or it echos stuff, but not the stuff from the database, only stuff that I told it to echo that wasn't from the database. Some times the whole entire site won't load because it is hung up on the scripts that do the database, atleast that is what I suspect. This is so annoying. Btw, I am using PHP for all of this. I can't use "mysql_fetch_array($result)", for some reason I get this error saying something like "supplied argument is not a valid MySql resource", which only makes me think that it just plain isn't working when I try to use the SELECT and WHERE sql clauses. Well, actually, I think that I know that they aren't working, I just tested them by trying to get on simple little thing from the database and echo it, nothing echoed, I got no errors, but nothing echoed. Did I mention that this is really annoying? Well, it is. Oh, wait, I just got an idea. Maybe you can't include PHP variables inside a Sql statement…hmmm…I will get back to you on that, I know how I will test it. Well, if you have any suggestions or anything on what to do or what is wrong, please comment with it. Thanks.EDIT: Nope, making it not use variables does nothing. Instead of echoing what it should, it is echoing "Resource id #5". Now all I can think is it isn't connecting to the database right…hmm, let me try a FreeSql (Free Database Hosting Site) database real quick and see what it does…
do you have php and mysql enabled?
Yeah thats probly the problem
Yep, I have both enabled…
I figured it out. The database I was using doesn't work for one reason or another, lol…
I like to use
mysql_query("whatever") or die(mysql_error())mysql_error() will tell you the latest error in mysql. What that invalid resource thing was telling you, was that the $result sql object you were sending as an argument, wasnt' an actual sql object.Ok, thanks firestormx.