Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-29-2005, 06:52 AM displaying 1 message
feraira's Avatar
BeTheBand!

Posts: 350
Trades: 0
hey all, got another slight problem, i get the error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xingeh/public_html/viewmessages.php on line 10

when i click on any of my messages on my inbox.
the code i have for the page is:

Code:
<?
// Get the ID for the message!
$messid = $_GET["messid"];

// Connect to the database, pull the required information out!
lalal
lalla

$result=mysql_query("SELECT * FROM messenger WHERE messid=".$messid."");
while($row=mysql_fetch_array($result)) {

$messid= $row['messid'];
$userid = $row['userid'];
$authorid = $row['authorid'];
$message = $row['message'];
$authorname = $row['authorname'];
$messtitle = $row['messtitle'];

// Show the message

echo("Message $messid");
echo("<br><br>");
echo("Message from: $authorname");
echo("<br>");
echo("Message title: $messtitle");
echo("<br>");
echo("The message:");
echo("<br><br>");
echo("$message");

} 
mysql_close();
?>
feraira is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-29-2005, 07:07 AM
Marvin Le Rouge's Avatar
Skilled Talker

Posts: 52
Trades: 0
Hi,

1) Put your query in a string
2) Display it
3) Display mysql_error()

You will probably find out the cause.
Marvin Le Rouge is offline
Reply With Quote
View Public Profile
 
Old 05-29-2005, 07:35 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
try changeing the row to this:

PHP Code:
$result=mysql_query("SELECT * FROM messenger WHERE messid='".$messid."'"); 
might help ... not sure though.

also ... before trying to fetch data try and check is there's anything to fetch.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-29-2005, 10:08 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
We solved this one on im - the get variable was named wrong, the URLs had msg=x and not messid=x
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 05-29-2005, 03:03 PM
feraira's Avatar
BeTheBand!

Posts: 350
Trades: 0
lol, yeah me an oberon (he rocks!) sorted out the problem! thanks for the help tho guys!
feraira is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to displaying 1 message
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59477 seconds with 12 queries