I have the database. its has sample data. I can see the sample data from another machine. 'ssh'd' into the server and running mysql with appropriate commands.
I have forms to retrieve the data and display the data on the screen in a series of labels with data, with carriage return line feeds after each label and data. I need to display the data on a form that resembles the original new record entry screen.
I cannot for the life of me get the data retrieved from the database to display in the input text boxes on the form. All I get is the command syntax displayed in the text box.
please tell what I am missing. the code below contains statements built in for testing purposes. the search will not always be for a plate = METP.
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>Update Form</title>
- </head>
- <body>
- Vehicle Update Form<p>
- <?php
- $conn = mysql_connect("localhost","root","");
- mysql_select_db("impound",$conn);
- $sql = "SELECT * FROM impound_record WHERE plate = 'METP'";
- $result = mysql_query($sql,$conn) or die(mysql_error());
- while ($row = mysql_fetch_array(result)){
- $vehid = $row['vehid'];
- $incident = $row['incident'];
- $plate = $row['plate'];
- $juris = $row['juris'];
- $vin = $row['vin'];
- $year = $row['year'];
- $make = $row['make'];
- $model = $row['model'];
- $colour = $row['colour'];
- $reason = $row['reason'];
- $location = $row['location'];
- $owner_name = $row['owner_name'];
- $owner_lic = $row['owner_lic'];
- $owner_address = $row['owner_address'];
- $released_to = $row['released_to'];
- $taken_by_name = $row['taken_by_name'];
- $taken_by_lic = $row['taken_by_lic'];
- $taken_by_address = $row['taken_by_address'];
- $driver_name = $row['driver_name'];
- $driver_telephone = $row['driver_telephone'];
- $driver_lic = $row['driver_lic'];
- $driver_address = $row['driver_address'];
- $invoice1 = $row['invoice1'];
- $invoice2 = $row['invoice2'];
- $invoice3 = $row['invoice3'];
- $datein = $row['datein'];
- $dateout = $row['dateout'];
- $last_record_update = $row['last_record_update'];
- $impound_type = $row['impound_type'];
- $vehkeys = $row['vehkeys'];
- $total_release_charge = $row['total_release_charge'];
- $driver_in = $row['drive_in'];
- $driver_out = $row['driver_out'];
- ?>
- <FORM ACTION="update_modified.php" METHOD=POST>
- Incident Number
- <input type="text" name="incident" value="<?php echo $row['incident'];?>">
- Vehicle Marker
- <input type=text name="plate" value="<?php echo $row['plate']; ?>" size=10>
- Jurisdiction of Vehicle Marker
- <input type=text name="juris" value="<?php echo $row['juris']; ?>" size=5><br>
- <p>
- Vehicle Identification Number
- <input type=text name="vin" value="<?php echo $row['vin']; ?>" size=17>
- Vehicle Year of Manufacture
- <input type=text name="year" value="<?php echo $row['year']; ?>" size=4>
- Vehicle Make
- <input type=text name="make" value="<?php echo $row['make']; ?>" size=15>
- Vehicle Model
- <input type=text name="model" value="<?php echo $row['model']; ?>" size=15>
- Vehicle Colour
- <input type=text name="colour" value="<?php echo $row['colour']; ?>" size=15><br>
- <p>
- Reason for Impound
- <input type=text name="reason" value="<?php echo $row['reason']; ?>" size=15>
- Recovery Location
- <input type=text name="location" value="<?php echo $row['location']; ?>" size=50><br>
- <p>
- Owner Name
- <input type=text name="owner_name" value="<?php echo $row['owner_name']; ?>" size=50>
- Owner Driver License
- <input type=text name="owner_lic" value="<?php echo $row['owner_lic']; ?>" size=17>
- Owner Address
- <input type=text name="owner_address" value="<?php echo $row['owner_address']; ?>" size=50><br>
- <p>
- Released To
- <input type=text name="released_to" value="<?php echo $row['released_to']; ?>" size=50><br>
- <p>
- Taken By Name
- <input type=text name="taken_by_name" value="<?php echo $row['taken_by_name']; ?>" size=50>
- Taken By Driver License
- <input type=text name="taken_by_lic" value="<?php echo $row['taken_by_lic']; ?>" size=17>
- Taken By Address
- <input type=text name="taken_by_address" value="<?php echo $row['taken_by_address']; ?>" size=50><br>
- <p>
- Driver Name
- <input type=text name="driver_name" value="<?php echo $row['driver_name']; ?>" size=50>
- Driver Telephone
- <input type=text name="driver_telephone" value="<?php echo $row['driver_telephone']; ?>" size=10>
- Driver's Driver License
- <input type=text name="driver_lic" value="<?php echo $row['driver_lic']; ?>" size=17>
- Driver Address
- <input type=text name="driver_address" value="<?php echo $row['driver_address']; ?>" size=50><br>
- <p>
- Invoice 1
- <input type=text name="invoice1" value="<?php echo $row['invoice1']; ?>" size=6>
- Invoice 2
- <input type=text name="invoice2" value="<?php echo $row['invoice2']; ?>" size=6>
- Invoice 3
- <input type=text name="invoice3" value="<?php echo $row['invoice3']; ?>" size=6>
- Date Entered Facility
- <input type=text name="datein" value="<?php echo $row['datein']; ?>" size=10>
- Date Released from Facility
- <input type=text name="dateout" value="<?php echo $row['dateout']; ?>" size=10>
- Record Last Updated on
- <input type=text name="last_record_update" value="<?php echo $row['last_record_update']; ?>" size=10>
- <p>
- Impound Type
- <input type=text name="impound_type" value="<?php echo $row['impound_type']; ?>" size=10>
- Keys with Vehicle
- <input type=text name="vehkeys" value="<?php echo $row['vehkeys']; ?>" size=1>
- Total release charges
- <input type=text name="total_release_charge" value="<?php echo $row['total_release_charge']; ?>" size=10>
- Inbound Driver
- <input type=text name="driver_in" value="<?php echo $row['driver_in']; ?>" size=5>
- Outbound Driver
- <input type=text name="driver_out" value="<?php echo $row['driver_out']; ?>" size=5><br>
- <p>
- <input type=submit name="submit" value="Update"></p>
- </FORM>
- }
- </body>
- </html>