When I did my mysql table setup i made ans 1 thru 4 as INT DEFAULT '0' NOT NULL
and have the following code:
<?php
include "./settings.php";
$link = mysql_connect($dbhost,$dbuser,$dbpass);
if(!$link) {
echo "Could Not Connect To Database!";
}
if(!mysql_select_db($dbname)) {
echo "Error Getting DB";
}
$get = "SELECT ans1, ans2, ans3, ans4 FROM $table_name";
$it = mysql_query($get);
if(!$it) {
echo "Error With Query";
}
$data = mysql_fetch_array($it);
echo "Answer 1: $data[ans1] (votes)<br>";
echo "Answer 2: $data[ans2] (votes)<br>";
echo "Answer 3: $data[ans3] (votes)<br>";
echo "Answer 4: $data[ans4] (votes)<br>";
?>
I DISPLAYS
ANSWER 1: (votes)
ans so on without displaying the number i think it has something to do with my mysql_fetch_array or summat
plz help