Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP guestbook problem(newbie!!!!!!!!!!!!!)

Status
Not open for further replies.

Are8Jay

Programmer
Sep 22, 2002
17
0
0
US
I started with pre written script and used PHPAdmin to create the proper table in database but, the information isn't getting to the database. And where the Entries should be displayed I get:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/fidleronline.com/@@@@@@@/guestbook/guestbook.php on line 22.

I'm new at the PHP/MySQL not sure where to go or what to do. I've google'd the warning and get a whole lotta junk that doesn't make sence to me. Can Someone please help me by walking me through this problem. So, I can understand PHP/MySQL.

t-anks!
 
Plus, their is an error on the IE broswer:

Line: 5
Char: 205
Error: UNTERMINATED STRING CONSTANT!!
URl: ../guestbook.php

line: 5 of guestbook= The closing of my include statment and db_connection. ?>

line: 21 and 22 of guestbook=

$bring = mysql_query("select * from $table order by id desc");
while($r=mysql_fetch_array($bring))

This is all I got. Please help.
 
open that guestbook.php file, and copy& paste the few line of code above and below line 22
 
if the $table variable contains a single quote, and slashes weren't added the code above would give the error in the top post.

The IE error could be 2 things, so are you browsing the page as it is parsed by the server or opening it as a file:
1.) If the former, then you need to use IE's "view source" function because after being parsed by PHP the code isn't (and shouldn't) be the same as the local code and then look at whatever is on line 5 of the source.
2.) If the later, then there is your problem right there.

You'd have to post more of code to get a better answer, and also please use the code tag to disguish between code and text, as: line: 5 of guestbook= The closing of my include statment and db_connection. ?>
could be taken 2 different ways (even though you mean to say is probably that the
Code:
?>
is all that is on line 5 (which if you php tags matched up IE wouldn't see -- which is why I think your looking at pre-parsed code trying to solve a PHP error -- my guess is that IE error is in the code that your including from line 5 of the PHP file -- IE errors are typically JS errors)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top