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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.