RE: Looking for pointers to mysql functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- Graham Cossey <graham@xxxxxxxxxxxxxxx> wrote:


> Is this something like what you are after:
> 
> <?php
> $sql = "SELECT col1, col2, col3, col4 as colx, col5
>         FROM my_table
>         WHERE col2 LIKE '%$search%'
>         ORDER BY col3
> 	  LIMIT $from, $max_results";
> 
> $result = mysql_query($sql) or die ("Query failed: "
> . mysql_error());
> while($row = mysql_fetch_assoc($result))
> {
> ?>
>     <tr>
>       <td><?php echo $row['col2'] ?></td>
>       <td><?php echo $row['colx'] ?></td>
>     </tr>
> <?php
> }
> ?>
> 
> For details on how to do the x rows per page with
> previous and next see
> 
> http://www.phpfreaks.com/tutorials/43/0.php
> or
> http://www.phpfreaks.com/tutorials/73/0.php
> 
> HTH
> Graham
> 
Yes, I think this is it.  I appreciate the link to the
rows per page thing!
Very helpful as always!

Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux