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
what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
Old 06-15-2010, 03:28 PM what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
Skilled Talker

Posts: 53
Trades: 0
Hey guys, I'm fairly new to php and so I need some help on some stuff that should be basic. I'm trying to implement the following code to grab the name of a video, that I have stored in a mysql database. The video name is in the same row as the variable $url. When I try to implement the code I get the following warning "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource" And the warning refers to me to the line where I have put ####. This might seem like a rookie mistake but any help would be appreciated.

PHP Code:

<?php 
$url 
= ['www.mysite.com/examplevideo'];
 
?>

<?php
$query 
mysql_query("SELECT video_name FROM videos WHERE video_url = '$url' ");
while (
$row mysql_fetch_assoc($query))   ####
 
{
$videoname $row['video_name'];
}    
?>
worldy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-15-2010, 03:32 PM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It means your squery failed to return any results.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-15-2010, 04:12 PM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
Skilled Talker

Posts: 53
Trades: 0
So there wouldn't be any errors in my code then? its just a matter of the query returning nothing.
worldy is offline
Reply With Quote
View Public Profile
 
Old 06-15-2010, 04:37 PM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
So there wouldn't be any errors in my code then
Who knows?
We can only see a small part of the code.

Add some error checking to to the queries

http://www.php.net/manual/en/function.mysql-query.php
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-16-2010, 04:41 PM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
Skilled Talker

Posts: 53
Trades: 0
hmm thanks, ill look into the link.
worldy is offline
Reply With Quote
View Public Profile
 
Old 06-19-2010, 12:44 AM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
PHP Code:
$query mysql_query("SELECT video_name FROM videos WHERE video_url = '$url' ");
while (
$row mysql_fetch_assoc($query)); 
You have one too many " ) " ?

PHP Code:
$query mysql_query("SELECT video_name FROM videos WHERE video_url = '$url' ");
while (
$row mysql_fetch_assoc($query); 
__________________
Websites Created;
warscope.com
ratepayers.org.nz
lothop is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 09:00 AM Re: what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
Average Talker

Posts: 16
Trades: 0
It said that you query is not good.
__________________

Please login or register to view this content. Registration is FREE
- FileREX.com is an internet download website, from where you can download high-quality software.
perseadrian is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to what is a ""Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL"
 

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.25523 seconds with 12 queries