WHERE id = ? AND FirstImage IN (0,1) order by FirstImage desc
view selected picture first - if not view other pictures.
i thank all my friends who help.
with love...
Example Code:
$sql=$baglan->prepare("SELECT * FROM img where id='$getx') and if (FirstImage==1 echo FirstImage=1 ; else FirstImage==0 echo FirstImage=0 ) "); // AS ETC.
$sql->execute();
$rs = $sql->fetch();
if FirstImage=1 is absent, continue with FirstImage=0
Thanks for your idea and effort.
thank you but this is not the solution.
As if there were no first 10 records - next 10 records will be print to the screen.
$sqlq=$connectx->prepare("SELECT * FROM lovetree WHERE id > -10");
- 10 record go back
I want to list the previous (minus) 10 records.
classic asp example: <% do while not rs.eof and i< 7 %>
how to do with php pdo?
My code is this:
<?php
$sqlq=$connectx->prepare("SELECT * FROM lovetree ");
$sqlq->execute();
while($rs = $sqlq->fetch()) {
echo $rs['tree'];
}
?>
Thanks...
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.