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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.