Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

New to PHP and having a problem



4:14 am on May 28, 2005 (gmt 0)

10+ Year Member


So I'm new to PHP although I have a good base knowledge of how all of this stuff works and I installed a directory that consists of some simple php scripts and enters the info to a mysql database.

I am looking to install a banner rotator and have it installed on another inferior directory that is encoded in php as well.

Now the scripts for the directory were created by dB Masters Multimedia Directory and I found the appropriate place to insert the code from the banner rotator which uses phpadsnew and is quite awesome open source free ad server.

When I add the block of code for the ad server in the correct place all the stuff from the database (all links and categories from directory) disappears.

Anybody know what could make that happen?


So can anyone help? Make a suggestion?

This is the first major step in PHP and it seems so basic and small but I can't see what's going on.

[edited by: ergophobe at 8:45 am (utc) on May 28, 2005]
[edit reason] code dump snipped - see forum charter [/edit]


5:18 am on May 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Have you tried using PHP error reporting?


That might turn something up. No errors stand out in your code that I can see.


6:03 am on May 28, 2005 (gmt 0)

10+ Year Member

Thanks for the reply.

I haven't but not sure where in the code I'd put that. Just add it in at the bottom as a PHP segment?

Like this?



6:05 am on May 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I add it at the top of my code. Normally commented out, but very handy to have around when things break for no good reason.


6:46 am on May 28, 2005 (gmt 0)

10+ Year Member

wow all kinds of errors. I'm not even sure where to start...

A bunch of undefined variables and a "supplied argument is not a valid MySQL result resource"

Not even sure where to start with this stuff. Any tips?


8:55 am on May 28, 2005 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

The MySQL error is probably a secondary consequence of the undefined variables... or it might be anyway.

Start by echoing out any queries you send as in

$q = "SELECT blah blah";
echo $q;
$r = mysql_query($q);

Now copy and paste the query into your mysql client and see if it works.

For more help, try this


Featured Threads

Hot Threads This Week

Hot Threads This Month