Will998999
New member
im sure that this is an easy one and im missing something obvious but with this code:
<?php
session_start();
if ($_SESSION['username'])
{
}
else
{
die("You are not Logged in!");
}
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$location = $_POST['location'];
$connect = mysql_connect("localhost","root","") or die("could not connect");
mysql_select_db("Link databases") or die("could not find db");
$query = mysql_query("select * FROM users WHERE username='$firstname'");
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
echo "Results: ".$row."<br>";
}
}
else {
echo "Nobody Found
";
}
?>
the nobody found bit works but when it finds someone in the database that matches the search it just prints results: array any help??? thanks in advance
<?php
session_start();
if ($_SESSION['username'])
{
}
else
{
die("You are not Logged in!");
}
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$location = $_POST['location'];
$connect = mysql_connect("localhost","root","") or die("could not connect");
mysql_select_db("Link databases") or die("could not find db");
$query = mysql_query("select * FROM users WHERE username='$firstname'");
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
echo "Results: ".$row."<br>";
}
}
else {
echo "Nobody Found
}
?>
the nobody found bit works but when it finds someone in the database that matches the search it just prints results: array any help??? thanks in advance