Its the first time i connected to mysql today, and it was sucessful, and i INSERTED the data into table successfully, but while fetching i got errors.
code is
and error is
when i use this code
error come
can you plese help me finding the problem?
the book from where i am reading, gives a similar example, but when i use this code, errors occure in all the way.
code is
| Code: |
| <?php
mysql_connect('localhost', 'root'); mysql_select_db('test'); $query= "SELECT registrant_info FROM * WHERE reg_id=1"; $result=mysql_query($query); while($output=mysql_fetch_array($result)) echo "$output['reg_first']"; ?> |
and error is
| Code: |
| Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\database.php on line 11 |
when i use this code
| Code: |
| <?php
mysql_connect('localhost', 'root'); mysql_select_db('test'); $query= "SELECT registrant_info FROM * WHERE reg_id=1"; $result=mysql_query($query); while($output=mysql_fetch_array($result)) echo "$output[0]"; ?> |
error come
| Code: |
| Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\database.php on line 10 |
can you plese help me finding the problem?
the book from where i am reading, gives a similar example, but when i use this code, errors occure in all the way.
