Jump to content

[SOLVED] mysql_fetch_array - Problems.


Lamez

Recommended Posts

ok I posted here yesterday (http://www.phpfreaks.com/forums/index.php/topic,219037.0.html). Well I took one of the poster advice, and decided that was a better, and cleaner way to organize the DB.

 

However, I tried it, and I am having problems pulling it out of the database.

 

here is my error:

1. Atlantic Coast Conference, Bonston College

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mounted-storage/home48c/sub007/sc33591-LWQU/picks_web/all.php on line 10

 

Here is line 10:

<?php
while ($q = mysql_fetch_array($q)){
?>

 

here is the whole code:

<?php
$path = "";
$title = "All Football Teams in DB"; 
$rank = "yes"; 
include ($path."main/include/cons/head.php");

$q = mysql_query("SELECT * FROM `foot_teams`");


while ($q = mysql_fetch_array($q)){
  $num += 1;
  $team = $q['confer'].', '.$q['team'];
  echo $num.'. '.$team;
}

include ($path."main/include/cons/foot.php");
?>

 

Now it has been a while since I have done anything with PHP or MySQL, so please do not "flame" me, or call me a noob, which I am.

 

Thanks Guys!

Link to comment
https://forums.phpfreaks.com/topic/126703-solved-mysql_fetch_array-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.