Page 1 of 1
database search and show in website?
Posted: Thu Jan 08, 2009 1:41 pm
by bd_safa
hello everyone
i am having a little problem with how i can have a page similar to the images below, i am still a noob in php and sql , so please help me out

Re: database search and show in website?
Posted: Thu Jan 08, 2009 6:45 pm
by it2051229
what do you mean by similar page? you mean those two output should be located in a single PHP file and using PHP to decide which one to display?
Re: database search and show in website?
Posted: Fri Jan 09, 2009 12:28 am
by bd_safa
it2051229 wrote:what do you mean by similar page? you mean those two output should be located in a single PHP file and using PHP to decide which one to display?
no, you give the refrence number and password in image 1, and php returns the info about the entery in image number 2, thats what i mean
Re: database search and show in website?
Posted: Fri Jan 09, 2009 4:05 am
by it2051229
great, have you started coding it?
Re: database search and show in website?
Posted: Fri Jan 09, 2009 6:51 am
by bd_safa
it2051229 wrote:great, have you started coding it?
well , since i am not good at sql, so i don't know where to start from!?

Re: database search and show in website?
Posted: Fri Jan 09, 2009 5:56 pm
by it2051229
this is not a tutorial website.. you start coding and when you have stuff that you dont understand or can't get it working then this is where we come in. There are a lot of free PHP Mysql Books you can download from the internet.
Re: database search and show in website?
Posted: Fri Jan 09, 2009 11:46 pm
by bd_safa
it2051229 wrote:this is not a tutorial website.. you start coding and when you have stuff that you dont understand or can't get it working then this is where we come in. There are a lot of free PHP Mysql Books you can download from the internet.
well , then let me finish the coding then i will let you know about it.
Re: database search and show in website?
Posted: Mon Jan 12, 2009 12:15 am
by bd_safa
Cheers, I finished the coding and it works well, if you want the codes , just let me know.

Re: database search and show in website?
Posted: Mon Jan 12, 2009 1:41 am
by it2051229
just make sure its worth looking at it.
Re: database search and show in website?
Posted: Mon Jan 12, 2009 1:17 pm
by bd_safa
here we go :
<style type="text/css">
<!--
body {
margin-left: 30px;
}
-->
</style><?
$refr_field = $_POST['refr'];
$pass_field = $_POST['pass'];
$user="user";
$password="pass";
$database="database";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM status WHERE ref=$refr_field";
$result=mysql_query($query);
echo "<b><center>Onine Paper Status Report</center></b><br><br>";
if (mysql_num_rows($result)==0){
echo "The refrence number or password is incorrect or the paper is removed, please contact the office for more information";
exit;
}
while ($row=mysql_fetch_assoc($result)){
if ($pass_field==$row["pass"]){
echo "<b>Refrence Number:</b><br>";
echo $row["ref"];
echo "<br><b>Paper Title:</b><br>";
echo $row["title"];
echo "<br><b>Authors:</b><br>";
echo $row["auth"];
echo "<br><b>Correspondens:</b><br>";
echo $row["cor"];
echo "<br><b>Paper Status:</b><br>";
echo $row["stat"];
echo "<br><b>Message from editor:</b><br>";
echo $row["msg"];
} else {
echo "The refrence number or password is incorrect or the paper is removed, please contact the office for more information";
}
}
mysql_free_result($result);
?>
Re: database search and show in website?
Posted: Mon Jan 12, 2009 5:30 pm
by it2051229
ok you wasted my time, it's not worth looking at. oh and good start.