February 27, 201214 yr Hey guys me again. Atm I'm receiving undefined index when I try to echo out a table. Mine code; <?php include("config.php"); $sql=mysql_query("SELECT post FROM news"); $rij=mysql_fetch_array($sql); $row=mysql_fetch_assoc($sql); echo $row['number']; echo $rij['number']; echo $rij['post']; echo "<br>"; ?> Number table setting; Column; number Type; INT Length/Values;255 Auto_Increment; (tried it both on yes and no) Anyone have any idea or must I echo it out in a different way?
February 27, 201214 yr using var_dump() would save the need to post messages like this again. http://uk3.php.net/var_dump Also look at the documentation for the functions your trying to use as they have code samples on how to use them.... the php manual is probbly one of the best dev docs ive used. http://uk.php.net/mysql_fetch_assoc Edited February 27, 201214 yr by SniderDK
February 27, 201214 yr Hey guys me again. Atm I'm receiving undefined index when I try to echo out a table. Mine code; <?php include("config.php"); $sql=mysql_query("SELECT post FROM news"); $rij=mysql_fetch_array($sql); $row=mysql_fetch_assoc($sql); echo $row['number']; echo $rij['number']; echo $rij['post']; echo "<br>"; ?> Number table setting; Column; number Type; INT Length/Values;255 Auto_Increment; (tried it both on yes and no) Anyone have any idea or must I echo it out in a different way? u have to select every field ur outputting $sql=mysql_query("SELECT `post`,`number` FROM news");
March 1, 201214 yr Author There was some bug in the wamp server. After re-installing the wamp program and re-create the table and re-create the code it finnaly worked correctly. Oh well thanks for the headups.
March 2, 201214 yr There was some bug in the wamp server. After re-installing the wamp program and re-create the table and re-create the code it finnaly worked correctly. Oh well thanks for the headups. mmm from what i can see the only bug was in ur code lol but none the less glad u got it working
Create an account or sign in to comment