![]() |
Whats the error?
<?php
session_start(); $username=$_SESSION['username']; $fname; $lname; $guardian; $connect = mysql_connect("localhost","root","") or die ("Couldn't connect"); mysql_select_db("school_inspirations") or die("Couldn't find db"); $fname = mysql_query("SELECT fname FROM student_reg WHERE username='$username'"); mysql_query($fname); $guardian = mysql_query("SELECT guardian FROM student_reg WHERE username='$username'"); mysql_query($guardian); ?> <table border=1px;> <tr> <td> Fullname </td> <td> <?php echo "$fname"; ?> </td> </tr> </table> The ouput in the table is Resource id #3 |
wouw dude, hold on.
Please read once over your code: Quote:
then you trigger a mysql_query from the result you got from the sql query: the code should look like that: PHP Code:
Your error means simply that you dont have an string available - so you cannot print/echo it |
@up- Better for the query part is to use it like this:
PHP Code:
|
| All times are GMT. The time now is 05:20 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0