SQL return if not found

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: SQL return if not found

Post by liljester »

ok, for now atleast until you get the logic ironed out, try using the native mysql_ functions instead of your db helper functions. lets limit the things that can be causing issues :) with a quick look it appears your helper functions are done right but its midnight and it was just a quick look..

so try mysql_query(), and mysql_num_rows().
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: SQL return if not found

Post by MHardeman25 »

ok, if I get rid of my SQL_Connect file, and put the sql in the same file, then it works.
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: SQL return if not found

Post by liljester »

yay :)
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: SQL return if not found

Post by MHardeman25 »

kind of, I still want to use that file though. It cuts down on the writing the code at the begining of every page. Why does it not work when the database connection are in a different place?
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: SQL return if not found

Post by MHardeman25 »

ill work on it tomorrow. It's late. If any of you have some blinding insight on what's going on. Let me know.
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: SQL return if not found

Post by liljester »

all you need to include in your connect file is the connection to the database, you dont have to wrap all of the mysql functions in your own functions.
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: SQL return if not found

Post by MHardeman25 »

But if I do all the connections in the connect file, and I try to use that stuff in a different file, then it won't find the variables. It'll give me a undefined variable error.
Post Reply