diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-20 13:38:08 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-20 13:38:08 -0500 |
commit | be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c (patch) | |
tree | 6f20672cf5df66044b3fa9dd71fc3bcdc484abe6 /ajax/database/getuser.php | |
parent | 1a619f2638a4f77fb8ea9557edeefb883d8c06f8 (diff) | |
download | bayonetcms-be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c.tar.gz |
Test.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'ajax/database/getuser.php')
-rw-r--r-- | ajax/database/getuser.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ajax/database/getuser.php b/ajax/database/getuser.php new file mode 100644 index 0000000..bf6e677 --- /dev/null +++ b/ajax/database/getuser.php @@ -0,0 +1,38 @@ +<?php +$q=$_GET["q"]; + +$con = mysql_connect('localhost', 'peter', 'abc123'); +if (!$con) + { + die('Could not connect: ' . mysql_error()); + } + +mysql_select_db("ajax_demo", $con); + +$sql="SELECT * FROM user WHERE id = '".$q."'"; + +$result = mysql_query($sql); + +echo "<table border='1'> +<tr> +<th>Firstname</th> +<th>Lastname</th> +<th>Age</th> +<th>Hometown</th> +<th>Job</th> +</tr>"; + +while($row = mysql_fetch_array($result)) + { + echo "<tr>"; + echo "<td>" . $row['FirstName'] . "</td>"; + echo "<td>" . $row['LastName'] . "</td>"; + echo "<td>" . $row['Age'] . "</td>"; + echo "<td>" . $row['Hometown'] . "</td>"; + echo "<td>" . $row['Job'] . "</td>"; + echo "</tr>"; + } +echo "</table>"; + +mysql_close($con); +?>
\ No newline at end of file |