Jump to content

whats wrong with this code?


nimametu

Recommended Posts

hi all could you please debug this code for me.there is a problem .the page dont load blank screen.php and mysql works properly i tested on other php files.

 

CODE :

 

 

<?php

 

$host = "localhost";

$user = "root";

$pwd = "root";

$username = $_POST["username"];

$password = $_POST["password"];

$database = "members";

 

$qry = "SELECT DISTINCT password FROM staff WHERE firstname=".$username;

 

 

$con = mysql_connect($host,$user,$pwd)

or die("cant connect to mysql");

 

mysql_select_db($database,$con)

or die("cant select database");

$result=mysql_query($qry,$con)

or die("Invalid Username Or Password");

$pas=mysql_fetch_array($result);

if (!$password==$pas[0])

{

die("Invalid Username Or Password");

}

 

$rq="SELECT * FROM ".$u;

$row=mysql_query($rq,$con)

or die("There Is No Messeges !");

echo ("<html>

<body>

<table border=1>");

for ($i=1;i=mysql_num_rows($row);$i++)

{

$sqry="SELECT DISTINCT messege FROM ".$u." WHERE id=".'$i';

 

$nresult=mysql_query($sqry,$con)

or die("problem with num rows");

$print=mysql_fetch_array($nresult);

echo ("<TD>".$print[0]."</TD>");

}

echo ("</table></body></html>");

mysql_close($con);

?>

 

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/75753-whats-wrong-with-this-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.