Re: Problems using local server
Posted by:
CyberSpatium
(67.170.181.---)
Date: July 11, 2006 03:17AM
you only use case when you are using switch. before you can use mysql_query you need to connect to mysql first.
<?php
$dbuser = 'root';
$dbpass = '_Your_Password_Here_';
$dbhost = 'localhost';
$dbbase = '_Your_Database_Here_';
$dblink = mysql_connect($dbhost, $dbuser, $dbpass) or die('Unable to connect to MySQL server');
$dbconnect = mysql_select_db ($dbbase, $dblink) or die(mysql_error());
$query = "SELECT * FROM User WHERE Login='" . $Login . "' AND Password='" . $Password . "'";
$result = mysql_query($query, $dblink);
$found = mysql_num_rows($result);
if($found != 0)
{
$tbs=new clsTinyButStrong;
$tbs->LoadTemplate('welcome.htm');
while ($row= mysql_fetch_array($result))
{
$First_name= $row['First_name'];
$Surname= $row['Surname'];
$Password= $row['Password'];
$User= $row['User'];
}
$query2= "Select * from bien";
$tbs->MergeBlock('blk',$connection,$query2);
$tbs->Show();
}
else
{
echo "<body bgcolor=#FF0000>";
echo "<center><br><br>";
echo "<font face=Verdana, Arial, Helvetica, sans-serif size=6><strong>";
echo "You are not allowed to view this information";
echo "</strong></font>";
echo "</center>";
echo "</body>";
}
?>