Hi,
This is my very first post, and I would SO appreciate help! I have been choking on this code for a month and can’t figure out what’s wrong. I know enough to understand what the code is supposed to do, just not enough to know why it’s not doing it. I have been getting this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in C:\wamp\www\statsdisplay.php on line 36
The html table header is displayed, followed by the error warning. Here is my code. I am wondering if there’s a problem with my data definitions. Thanks in advance, I’d love to finish this website, it’s a freebie and it’s taking WAY too long.
<?php $connection= mysql_connect("localhost","root",""); if (!$connection) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $connection); mysql_query("SELECT * FROM cougars"); $result = array(); echo "Number | Player | Height | Height | Position | Highschool | College |
---|---|---|---|---|---|---|
" . $row['Number'] . " | "; echo "" . $row['Player'] . " | "; echo "" . $row['Height'] . " | "; echo "" . $row['Weight'] . " | "; echo "" . $row['Position'] . " | "; echo "" . $row['Highschool'] . " | "; echo "" . $row['College'] . " | "; echo "