homepage Welcome to WebmasterWorld Guest from 54.196.168.78
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
New to PHP and having a problem
uhzoomzip




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

Ok,

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?

[snip]

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]

 

grandpa




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

Have you tried using PHP error reporting?

error_reporting(E_ALL);

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

uhzoomzip




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

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?

<?php
error_reporting(E_ALL);
?>

grandpa




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

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.

uhzoomzip




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

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?

ergophobe




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

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
[webmasterworld.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved