Jump to content

uaeustudent

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

uaeustudent's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have this code for dislpay information (by the id of the user) was stored in the database but it give an error and I think it from this line $id = $_GET['id']; $query = "SELECT * FROM $table WHERE id='$id'LIMIT 1"; And this my code: ]<html> <head> <title>Title here!</title> </head> <body> <?php $host = "localhost"; $user = ""; $password = ""; $db = "Job seeker"; $table = "personalinformation"; mysql_connect($host,$user,$password) or die("Failed to connect"); mysql_select_db($db) or die("Falied to select database"); $id = $_GET['id']; $query = "SELECT * FROM $table WHERE id='$id'LIMIT 1"; //$query = "SELECT * FROM $table WHERE id='$id' LIMIT 1"; $result = mysql_query($query) or die("problem with query: ".$query); $row = mysql_fetch_array($result); if ($row){ // echo "<td><td><tr>$myrow[id]</tr><tr>$myrow[Address]</tr><tr>$myrow[City]</tr><tr>$myrow[Fax]</tr><tr>$myrow[specialization]</tr><tr>$myrow[TargetSalary]</tr><tr>$myrow[JobType]</tr><tr>$myrow[WillingToRelocate]</tr></td></td>" ; } else { echo "mysql Error: " . mysql_error(); } ?> <h3> Personal Information form</h3> <table border=1> <tr> <td>id</td> <td><?=$row['id'];?></td> </tr> <tr> <td>Address</td> <td><?=$row['Address'];?></td> </tr> <tr> <td>City</td> <td><?=$row['City'];?></td> </tr> <tr> <td>Fax</td> <td><?=$row['Fax'];?> </td> </tr> <tr> <td>Specialization</td> <td><?=$row['Specialization'];?></td> </tr> <tr> <td>TargetSalary</td> <td><?=$row['TargetSalary'];?></td> </tr> <tr> <td>JobType</td> <td><?=$row['JobType'];?></td> </tr> <tr> <td>WillingToRelocate</td> <td><?=$row['WillingToRelocate'];?> </td> </tr> </table> </body> </html>
  2. I want a code in php to display the information was insertsd and stored in the database
  3. Sorry but I change the code but it doesnt work The code <html dir="rtl" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Job Preference form</title> </head> <body onload="FP_preloadImgs(/*url*/'button109.jpg', /*url*/'button110.jpg', /*url*/'button111.jpg', /*url*/'button112.jpg', /*url*/'button113.jpg', /*url*/'buttonD3.jpg', /*url*/'button117.jpg', /*url*/'button118.jpg')"> <?php $host = "localhost"; $user = ""; $password = ""; $db = "job seeker"; $table = "personalinformation"; ?> <p dir="ltr" align="center"> </p> <p align="center"></p> <p align="center"><a href="Skill.htm" target="bottom"> <input style="visibility:hidden;"img border="0" id="img10" src="button119.jpg" height="26" width="130" alt="Skill" onmouseover="FP_swapImg(1,0,/*id*/'img10',/*url*/'button117.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img10',/*url*/'button119.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img10',/*url*/'button118.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img10',/*url*/'button117.jpg')" fp-style="fp-btn: Braided Row 2" fp-title="Skill"></a><a href="Workexperience.html" target="bottom"><input style="visibility:hidden;"img border="0" id="img9" src="button114.jpg" height="26" width="130" alt="Work Experince" onmouseover="FP_swapImg(1,0,/*id*/'img9',/*url*/'button113.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img9',/*url*/'button114.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img9',/*url*/'buttonD3.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img9',/*url*/'button113.jpg')" fp-style="fp-btn: Braided Row 2" fp-title="Work Experince"></a><a href="Education.htm"><input style="visibility:hidden;"img border="0" id="img7" src="button115.jpg" height="26" width="130" alt="Education" onmouseover="FP_swapImg(1,0,/*id*/'img7',/*url*/'button110.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img7',/*url*/'button115.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img7',/*url*/'button109.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img7',/*url*/'button110.jpg')" fp-style="fp-btn: Braided Row 2; fp-orig: 0" fp-title="Education"></a><a href="PersonalInfo.html" target="bottom"><img border="0" id="img8" src="button116.jpg" height="26" width="130" alt="Personal Information" onmouseover="FP_swapImg(1,0,/*id*/'img8',/*url*/'button111.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img8',/*url*/'button116.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img8',/*url*/'button112.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img8',/*url*/'button111.jpg')" fp-style="fp-btn: Braided Row 2" fp-title="Personal Information"></a><img border="0" src="1.jpg" width="984" height="72"></p> <p> </p> <table border="0" width="100%" id="table1"> <tr> <td> <p align="left"> <input type="hidden" name="id" size="20" value="$myrow[id]"></td> </tr> <tr> <td> <p align="left"><b><font size="5">Personal Information form</font><span style="font-size: 12.0pt; font-family: Verdana; color: black"> </span></b></td> </tr> <tr> <td> <p align="left"> <input type="text" name="Address" size = "20">Addres </td> </tr> <tr> <td> <p align="left"><input type="text" name="City" size="20" >City </td> </tr> <tr> <td> <p align="left"><input type="text" name="Fax" size="20">Fax </td> </tr> <tr> <td> <p align="left"><b><font size="5">Job Preference form</font></b></td> </tr> <tr> <td> <p align="left"><select size="1" name="Specialization"> <option> select------------------------------------------------------- </option> <option value="Network engineering">Network engineering</option> <option value="Software engineering">Software engineering</option> <option value="Information">Information</option> <option value="E-commerce">E-commerce</option> <option value="Computer Secience">Computer Secience</option> <option value="Computer System Engineering.">Computer System Engineering.</option> <option value="Computer Security">Computer Security</option> </select> Specialization </td> </tr> <tr> <td> <p align="left"><select size="1" name="TargetSalary" <?=$row['TargetSalary'];?>> <option>Select------------------------------------------------------ </option> <option value="Dhs:1000-3000">Dhs:1000-3000</option> <option value="Dhs:4000-6000">Dhs:4000-6000</option> <option value="Dhs:7000-9000">Dhs:7000-9000</option> </select>Target salary </td> </tr> <tr> <td> <p align="left"> <span style="font-size: 12.0pt; font-family: Times New Roman"> <select size="1" name="JobType" <?=$row['Fax'];?>> <option>Select----------------------------------------------------- </option> <option value="Permanent">Permanent</option> <option value="Current">Current</option> <option value="Part time">Part time</option> <option value="Internship">Internship</option> </select>Job Type </span></td> </tr> <tr> <td> <p align="left"><span dir="LTR">Yes, any where</span><span style="font-size: 12.0pt; font-family: Times New Roman"><input type="radio" value="YES" name="WillingToRelocate">No <input type="radio" value="No" name="WillingToRelocate" checked> Willing to Relocate </span></td> </tr> </table> <p> </p> <p> </p> <p align="center"><input type="reset" value="Reset" name="B2"><input type="submit" value="Submit" name="B1"></p> </form> <p align="left"> </p> <?php mysql_connect($host,$user,$password) or die("Failed to connect"); mysql_select_db($db) or die("Falied to select database"); $sql = "SELECT * FROM $table ORDER BY id ASC;"; $result = mysql_query($sql); if ($result){ while ($myrow = mysql_fetch_array($result)){ //echo "<tr><td>$myrow[id]<td>$myrow[Address]<td> $myrow[City]<td>$myrow[Fax]<td>$myrow[specialization]<td>$myrow[TargetSalary]<td>$myrow[JobType]<td>$myrow[WillingToRelocate]"; echo "<tr><td>$myrow[id]></td></tr>"; "<tr><td>$myrow[Address]</td></tr>"; "<tr><td>$myrow[City]</td></tr>"; "<tr><td>$myrow[Fax]</td></tr>"; "<tr><td>$myrow[specialization]</td></tr>"; "<tr><td>$myrow[TargetSalary]</td></tr>"; "<tr><td>$myrow[JobType]</td></tr>"; "<tr><td>$myrow[WillingToRelocate]</td></tr>"; }} else { echo "mysql Error: " . mysql_error(); } ?> </body> </html>
  4. Thanks all for your help, but I have tow comand First when I change the php code I have this result : problem with query: SELECT * FROM WHERE id= LIMIT 1 Secondly, where I should put this code <?=$row['address'];?>
  5. Hi all; I am working in php cade. I have page to insert information, and other page include button linked to that page. But it should contain the information which was inserted. This is my code " they are all in the same page" PHP Code: <?php $host = "localhost"; $user = ""; $password = ""; $db = "job seeker"; $table = "personalinformation"; mysql_connect($host,$user,$password) or die("Failed to connect"); mysql_select_db($db) or die("Falied to select database"); $sql = "SELECT * FROM $table ORDER BY id ASC;"; $result = mysql_query($sql); $id = $_GET["id"]; $sql = "SELECT * FROM $table WHERE id='$id'"; ?> HTML Code: <html> <html dir="rtl" xmlns:v="urn:schemas-microsoft-com:vml" xmlns="urn:schemas-microsoft-comfficeffice" xmlns="http://www.w3.org/TR/REC-html40"> <head> </script> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Job Preference form</title> </head> <body onload="FP_preloadImgs(/*url*/'button26.jpg',/*url*/'button25.jpg',/*url*/'button1C.jpg',/*url*/'button1B.jpg',/*url*/'button19.jpg',/*url*/'button18.jpg',/*url*/'button2D.jpg',/*url*/'button2C.jpg')"> <form method="GET" action="db_insertPersonalInfo.php" onSubmit="return checkForm()" name="Form"> <p dir="ltr" align="center"> &nbsp ; & nbsp; &nb sp; &nbsp ; & nbsp; &nb sp; &nbsp ; </p> <p align="center"></p> <p align="center"><a href="Skill.htm" target="bottom"></a><img border="0" src="1.jpg" width="984" height="72"></p> <p> </p> <table border="0" width="100%" id="table1"> <tr> <td> <p align="left"><b><font size="5">Personal Information form</font><span style="font-size: 12.0pt; font-family: Verdana; color: black"> </span></b></td> </tr> <tr> <td> <p align="left"> <input type="text" name="Address" size="20" value="$myrow[Address]">Address </td> </tr> <tr> <td> <p align="left"><input type="text" name="City" size="20" value="$myrow[City]">City </td> </tr> <tr> <td> <p align="left"><input type="text" name="PhoneNumber" size="20" value="$myrow[PhoneNumber]">PhoneNumber </td> </tr> <tr> <td> <p align="left"><input type="text" name="Fax" size="20" value="$myrow[Fax]">Fax </td> </tr> <tr> <td> <p align="left"><b><font size="5">Job Preference form</font></b></td> </tr> <tr> <td> <p align="left"><input type="text" name="Fax" size="20" value="$myrow[specialization]">Specialization </td> </tr> <tr> <td> <p align="left"><input type="text" name="Fax" size="20" value="$myrow[TargetSalary]">TargetSalary </td> </tr> <tr> <td> <p align="left"><input type="text" name="Fax" size="20" value="$myrow[JobType]">JobType </td> </tr> <tr> <td> <p align="left"><span dir="LTR"></span><span style="font-size: 12.0pt; font-family: Times New Roman"> <input type="radio" value="$myrow[WillingToRelocate]" name="WillingToRelocate"> Willing to Relocate </span></td> </tr> </table> <p> </p> <p> </p> <img border="0" id="img11" src="file:///D:/Documents%20and%20Settings/200401661/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/button2.jpg" height="20" width="100" alt="Next" onmouseover="FP_swapImg(1,0,/*id*/'img11',/*url*/'file:///D:/Documents%20and%20Settings/200401661/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/button3.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img11',/*url*/'file:///D:/Documents%20and%20Settings/200401661/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/button2.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img11',/*url*/'file:///D:/Documents%20and%20Settings/200401661/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/button4.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img11',/*url*/'file:///D:/Documents%20and%20Settings/200401661/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/button3.jpg')" fp-style="fp-btn: Braided Row 2" fp-title="Next" align="left"> </form> <p align="left"> </p> </body> </head>
×
×
  • 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.