Hi,
Please help me why my code generating error..
Parse error: syntax error, unexpected '>' in line 85...that line showned below in bold letters.
This code for both deleting,
if mode=delete, then it will delete the row
else,
It will generate a form to modify the row details
MOD EDIT: Line #85 denoted by '***' comment
<?php
//database details
require('routedb.php');
// Gets data from url parameters
$planid=$_GET["tripid"];
$mode=$_GET["mode"];
// Opens a connection to a MySQL server
$connection = mysql_connect("localhost", $username,$password);
if (!$connection)
{
die('Not connected : ' . mysql_error());
}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected)
{
die ('Can\'t use db : ' . mysql_error());
}
$qry="select * from planroute where planid='$planid'";
$rslt=mysql_query($qry);
if (!$rslt)
{
die ('Query not correct: ' . mysql_error());
}
if($mode=='delete')
{
$qry1="delete FROM planroute where planid ='$planid'";
$rslt1=mysql_query($qry1);
if (!$rslt1)
{
die ('Query not correct: ' . mysql_error());
}
if(mysql_affected_rows())
{
//if deletion occured do some action
print("Record Deleted");
}
else
{
//if deletion not happened do some other operation
print("Do Something Different");
}
// echo "<script type=\"text/javascript\">alert('Row deleted');</script>";
}
else
{
while($row = mysql_fetch_array($rslt))
{
echo "<form type='text' action='updatetripsdetails.php? method='GET' target='_blank'>";
echo "tripID:<input type='text' name='tripid' value=".$row['planid']."><br>";
echo "Timeslot:<input type='text' name='timeslot' value=".$row['timeslot'].">(24hrs format and 11:00:00==110000 eg:130000-145000)<br>";
echo "RouteId:<select name='cmbrouteid' size='1'>";
$qry2= 'select routeid from routewithname';
$rslt2=mysql_query($qry2);
if (!$rslt2)
{
die ('Query not correct: ' . mysql_error());
}
while($rw2 = mysql_fetch_array($rslt2))
{
echo "<option>".$rw2['routeid']."</option>";
}
echo "</select></br></br>";
echo "VehicleId:<select name='cmbvehicleid' size='1'>;
$qry3= 'select vehicleid from vehicledetails';
$rslt3=mysql_query($qry3);
if (!$rslt3)
{
die ('Query not correct: ' . mysql_error());
}
while($rw3 = mysql_fetch_array($rslt3))
{
echo "<option>".$rw3['vehicleid']."</option>"; // *** Line 85 ***
}
echo "</select></br></br>";
echo "<input type='submit' value='Update'/></form>";
}
}
?>
Thanks in advance,
with sincerely,
sravan