is $uname containing string value? if yes, try '$uname'... and also try putting backslashes to your column name `uname`....
i faced this error before and this fixed it....
what is is the value of $year... it seems like $year and $i has the same value...
if $year is '2010', then try
<form action="archivednews.php" method="post">
<select name="year" id="year">
<?PHP
for($i='1986';$i<=date("Y");$i++){
if($year == $i) {
echo "<option value='$i' selected>$i</option>";
}
else {
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
<input type="submit" value="GO">
</form>
i found this by googling... not sure if this helps...
For primitives just use (string)$var or print this variable straight away. PHP is dynamically typed language and variable will be casted to string on the fly.
If you want to convert objects to strings you will need to define __toString() method that returns string. This method is forbidden to throw exceptions.
you have error at your while()...
try changing
while ($orderitem = mysql_fetch_array($orderlist)
);
(
$orderarray[] = $orderitem['id'];
)
to this
while ($orderitem = mysql_fetch_array($orderlist)){
$orderarray[] = $orderitem['id'];
}
you are closing the while loop before the $orderitem['id'] can be stored in $orderarray[]
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.