Log in

View Full Version : There are two mysql errors in my code



leonidassavvides
08-21-2008, 09:06 AM
There are two mysql errors in my code (how to debug?) when I go to get quote at http://www.poliscarhire.com/ errors at
http://www.poliscarhire.com/customeradmin/booking-review.php

first error line 725
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php:7) in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 725



725 session_start();
$_SESSION['datep']=$_POST['datep'];
$_SESSION['dated']=$_POST['dated'];
$_SESSION['Locationp']=$_POST['Locationp'];
$_SESSION['Locationd']=$_POST['Locationd'];
$_SESSION['days']=$_POST['days'];
$_SESSION['off']=$_POST['off'];
$_SESSION['mostdaysrate']=$_POST['mostdaysrate'];
$_SESSION['finalprice']=$_POST['finalprice'];
$_SESSION['cat']=$_POST['cat'];
$cat = $_SESSION['cat'];


second error line 811
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 811

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 812

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 813

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 814

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 815

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 816

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 817

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 818

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 819

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 820

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 821

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 822

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 823

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 824

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 825



811 $model = mysql_result($result,0,"model");
$type = mysql_result($result,0,"type");
$transm = mysql_result($result,0,"transm");
$cc = mysql_result($result,0,"cc");
$fuel = mysql_result($result,0,"fuel");
$doors = mysql_result($result,0,"doors");
$people = mysql_result($result,0,"people");
$suitcases = mysql_result($result,0,"suitcases");
$description = mysql_result($result,0,"description");
$availability = mysql_result($result,0,"availability");
$img_small = mysql_result($result,0,"img_small");
$img_big = mysql_result($result,0,"img_big");
$special_offer = mysql_result($result,0,"special_offer");
$discount = mysql_result($result,0,"discount");
$notes = mysql_result($result,0,"notes");
?>

motormichael12
08-21-2008, 04:57 PM
Could you post line 7 from the first error?

Also, could you post the query and the $result variable for the second error, as well as any variables involved in the query?

leonidassavvides
08-21-2008, 07:50 PM
For a query that results in only one entry(row), how reference differ fields ? problem second fixed-no definition of 'cat' var. well please tell me for first error ?

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php:7) in /home/content/p/o/l/polisch123/html/customeradmin/booking-review.php on line 725

may have two or more session_start(); ?

Also a new problem from the quote you get [on the left] of http://www.poliscarhire.com/
to the mysql repeat region, repeat buttons 2-6 do not work[js] the other 1, 7-16 buttons work properly, why this error ? is not a repeat ?

----------------------------------------------
line 7: I do not think this is the problem ?


<link rel="shortcut icon" href="favicon.ico" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Booking Review prior Sent</title>
line 7:<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
<!-- InstanceEndEditable -->


<?php $_SESSION['cat']=$_POST['cat'];
$cat = $_SESSION['cat'];
?>....
........
<?php
// --------------------------------------------------------------------------------
include("../dbinfo.php");
$linkid = mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die( "Unable to select database"); // @
// Base query
$query ='';
$query = "SELECT * FROM $CarsTable WHERE cat='$cat'";
$result = @mysql_query($query,$linkid);
$model = mysql_result($result,0,"model");
$type = mysql_result($result,0,"type");
$transm = mysql_result($result,0,"transm");
$cc = mysql_result($result,0,"cc");
$fuel = mysql_result($result,0,"fuel");
$doors = mysql_result($result,0,"doors");
$people = mysql_result($result,0,"people");
$suitcases = mysql_result($result,0,"suitcases");
$description = mysql_result($result,0,"description");
$availability = mysql_result($result,0,"availability");
$img_small = mysql_result($result,0,"img_small");
$img_big = mysql_result($result,0,"img_big");
$special_offer = mysql_result($result,0,"special_offer");
$discount = mysql_result($result,0,"discount");
$notes = mysql_result($result,0,"notes");
?>

leonidassavvides
08-21-2008, 07:58 PM
form1's submit button work but form2's not work,why[total 16 buttons] ?


<td align="center" valign="middle"><form action="../customeradmin/booking-review.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" target="_self">
<input type="hidden" name="datep" value="10:00 Friday August 22nd, 2008">
<input type="hidden" name="dated" value="10:00 Sunday August 31st, 2008">
<input type="hidden" name="Locationp" value="Polis Office">
<input type="hidden" name="Locationd" value="Polis Office">
<input type="hidden" name="days" value="9">
<input type="hidden" name="mostdaysrate" value="28">
<input type="hidden" name="off" value="50.4">
<input type="hidden" name="cat" value="B1">
<input type="hidden" name="finalprice" value="231.84">
<input type="hidden" name="car" value="Group B1-Hyundai Atoz or similar">
<a href="javascript:form1.submit()"><img src="../images/but_bookit.gif" width="80" height="22" border="0"></a>
</form></td>
</tr>
</table>
</fieldset>
</td></tr>
<tr><td><hr size="3" /></td></tr>
<link href="/css-styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #000000}
.style4 {color: #006699}
.style5 {color: #006600}
-->
</style>


<tr><td><fieldset><legend>Subcompact</legend><table width="580" border="0" cellpadding="5" cellspacing="0" class="menutext" summary="quote result table cell">
<tr>
<td width="132" rowspan="2">&nbsp;</td>
<td width="298">&nbsp;</td>
<td width="120">&nbsp;</td>
</tr>
<tr>
<td rowspan="3" align="center" valign="middle"><table width="104%" border="0" cellpadding="1" cellspacing="0" class="menutext" summary="characteristics table of car for rent">
<tr>
<td width="32%" align="left" valign="middle"><span class="style4"> model </span></td>
<td width="68%" align="left" valign="middle"><span class="style2">
Opel Corsa or Toyota Yaris </span></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="style4">people/door</span></td>
<td align="left" valign="middle"><span class="style2">
5 &nbsp;/&nbsp;
3</span></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="style4"> trans </span></td>
<td align="left" valign="middle"><span class="style2">
manual </span></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="style4"> size/fuel</span></td>
<td align="left" valign="middle"><span class="style2">
1000cc
&nbsp;/&nbsp;
Petrol</span></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="style4"> luggage </span></td>
<td align="left" valign="middle"><span class="style2">
2 small </span></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="style4"> status </span></td>
<td align="left" valign="middle"><span class="style2">
Available</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
<td rowspan="2" align="center" valign="middle"><p>&nbsp;<span class="text_normal20pxbold">€
32.5 </span>/day
</p>
<p>&nbsp;<span class="style4">total&nbsp;€
269.1 </span> <br>
&nbsp;<span class="style5">save&nbsp;€
58.5&nbsp;&nbsp;20% OFF
</span></p> </td>
</tr>
<tr>
<td height="38" align="center" valign="middle"><img src="/images/cars/b2_toyota_yaris.jpg" alt="Opel Corsa or Toyota Yaris" border="1" /></td>
</tr>
<tr>
<td height="65" align="center" valign="middle"><p>Group&nbsp;
B2 </p>
<p>

</p></td>
<td align="center" valign="middle"><form action="../customeradmin/booking-review.php" method="post" enctype="application/x-www-form-urlencoded" name="form2" target="_self">
<input type="hidden" name="datep" value="10:00 Friday August 22nd, 2008">
<input type="hidden" name="dated" value="10:00 Sunday August 31st, 2008">
<input type="hidden" name="Locationp" value="Polis Office">
<input type="hidden" name="Locationd" value="Polis Office">
<input type="hidden" name="days" value="9">
<input type="hidden" name="mostdaysrate" value="32.5">
<input type="hidden" name="off" value="58.5">
<input type="hidden" name="cat" value="B2">
<input type="hidden" name="finalprice" value="269.1">
<input type="hidden" name="car" value="Group B2-Opel Corsa or Toyota Yaris">
<a href="javascript:form2.submit()"><img src="../images/but_bookit.gif" width="80" height="22" border="0"></a>
</form></td>
</tr>
</table>

leonidassavvides
08-29-2008, 11:16 AM
Answer and this: a php session var an be reinitialized directly[re-asign a value to it] or it must virst unset ? required the unset ?