Current location: Hot Scripts Forums » Programming Languages » PHP » Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result ...


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result ...

Reply
  #1 (permalink)  
Old 01-11-04, 05:34 PM
hukka hukka is offline
New Member
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result ...

I have used this code in Lycos services and worked well, but now I have my homepages in other place and it does not work. Why?

<?php
print "<p><hr></p>";
$db = mysql_connect("localhost","name","password");
$HakuLause = "SELECT * FROM news order by ID desc";
$lauseen_tulos = mysql_query($HakuLause,$db);

$i = 0;
while ($kannanotto=mysql_fetch_row($lauseen_tulos))
{
if($i<3)
{
print "<p align=\"left\" class=\"style14\"><strong><a class=\"vari\" href=\"kannanotot.php?ID=$kannanotto[0]\">$kannanotto[1]
</a> <br>> $kannanotto[3]</strong></p>";

$i++;
}
}
print "<hr>";
?>

Now I get following warning:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/nimi/public_html/kannanottoja.php on line 14

Why? I have tried to solve this thing now for a while, but I guess I'm too tired. Problem must be esty to solve.
Reply With Quote
  #2 (permalink)  
Old 01-12-04, 12:16 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

You haven't selected which database to use for the query. Check this out:

PHP Manual: mysql_select_db()
http://ca.php.net/function.mysql-select-db

Good luck.
__________________
Blavv =|
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
wwwboard style board with modern functionality? complexprocess General HotScripts Site Discussion 11 09-03-03 03:15 AM


All times are GMT -5. The time now is 08:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.