Small profile problem!!!
Posted: Wed Mar 17, 2004 12:39 pm
I having being trying to create a script that takes the users input from a text box and searches the database for that username then shows their profile. I seem to be having problems for what reason i don't know. Can someone please help? Below is part of the script:
<?php
$searchuser = $_POST['searchuser'];
if (strlen($searchuser == ""))
{
echo "<b>You must enter a username before proceeding...</b><br>";
echo "<br>";
}
else
{
$link = mysql_connect("???", "???", "???");
mysql_select_db("???") or die("couldnt connect" . mysql_error());
$sql = mysql_query("SELECT * FROM members WHERE username = '$searchuser'") or die(mysql_error());
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_assoc($result);
echo "<center> <p><h3>User Information for ".$searchuser."</h3><p> </center>";
Regards
Joe
<?php
$searchuser = $_POST['searchuser'];
if (strlen($searchuser == ""))
{
echo "<b>You must enter a username before proceeding...</b><br>";
echo "<br>";
}
else
{
$link = mysql_connect("???", "???", "???");
mysql_select_db("???") or die("couldnt connect" . mysql_error());
$sql = mysql_query("SELECT * FROM members WHERE username = '$searchuser'") or die(mysql_error());
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_assoc($result);
echo "<center> <p><h3>User Information for ".$searchuser."</h3><p> </center>";
Regards
Joe