note 94918 added to function.parse-url

From: Date: Wed, 02 Dec 2009 20:56:28 +0000
Subject: note 94918 added to function.parse-url
Groups: php.notes 
Request: Send a blank email to php-notes+get-163504@lists.php.net to get a copy of this message
Hi everyone after reading through all the comments and trying out a number of things im still not completely sure on if my php script is possible. basically i am making a website for my company which lists jobs and i would like to be able to click on a job number and have it retrieve all the original information about that job to the job form so that it can be changed or updated. basically i have this. echo "<table border='1'>"; echo "<tr> <th><a href='".$link."'>Date</a></th> <th><a href='".$link."'>Job Number</a></th> <th><a href='".$link."'>Description</a></th> <th><a href='".$link."'>Customer</a></th> <th><a href='".$link."'>Contact Name</a></th> <th><a href='".$link."'>Responsible</a></th></tr>"; while($row = mysql_fetch_array( $result )) { $link = 'details.php?jobnumber=' . $row['jobnumber']; echo "<tr><td>"; echo $row['date']; echo "</td><td>"; //echo $row['jobnumber']; echo "<a href='".$link."'>".$row['jobnumber']."</a>"; echo "</td><td>"; echo $row['requirements']; echo "</td><td>"; echo $row['customer']; echo "</td><td>"; echo $row['contactname']; echo "</td><td>"; echo $row['responsible']; echo "</td></tr>"; } echo "</table>"; now this table makes it so all the "jobnumber" rows are clickable it then sends you to details.php?jobnumber=3306 (3306 is the job number it changes depending on which 1 you click) this is where i get stuck. i have created a full update job form which if i add all the fields in and press update it works perfectly fine BUT because it doesnt automatically bring the original information out some fields can be left blank meaning when update is clicked it wipes out that field in the database meaning data lost. so basically what im trying to get at is how can i make 'details.php' look at the section of the url that changes and then ask mysql for the data that the jobnumber presented has. from there i can manipulate it to go into the fields needed. Thanks for reading ive only been trying to learn php for about 3 weeks so try not to give me a hard time. ---- Server IP: 69.147.83.197 Probable Submitter: 203.190.210.84 ---- Manual Page -- http://www.php.net/manual/en/function.parse-url.php Edit -- https://master.php.net/note/edit/94918 Del: integrated -- https://master.php.net/note/delete/94918/integrated Del: useless -- https://master.php.net/note/delete/94918/useless Del: bad code -- https://master.php.net/note/delete/94918/bad+code Del: spam -- https://master.php.net/note/delete/94918/spam Del: non-english -- https://master.php.net/note/delete/94918/non-english Del: in docs -- https://master.php.net/note/delete/94918/in+docs Del: other reasons-- https://master.php.net/note/delete/94918 Reject -- https://master.php.net/note/reject/94918 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163504) next »