|
Posted by rich on 11/04/05 18:46
In article <VA.000003a3.005b72d3@freesurf.ch>, Otto says...
>
>Hello,
>I have the following script to move forward or backward to
>one record.
>Every thing work well. Only with the forward button and
>when the field NOM have one apostrophe ' inside, the skip
>process stop.
>
>Regards
>
>Otto
It looks like you are doing a numeric comparison with NOM, such as
nom >
nom <
nom =
Did you have the "nom" field in your "adresse" table defined as a integer?
Rich
--
Newsguy -- http://newsguy.com
>
>Part of the Script
>******************
>..
>If (isset($_GET['avant_x'])) {
> // Action sur le bouton suivant
> $mes = "Suivant";
> $query = " SELECT ID, NOM
> FROM adresse
> WHERE (nom > '$last_nom') OR (nom =
>'$last_nom' AND id > $last_id)
> ORDER BY nom ASC, id ASC LIMIT 1";
>
> extract(mysql_fetch_array(mysql_query($query)));
> }
>
>elseif (isset($_GET['arriere_x'])) {
> // Action sur le bouton prιcιdent
> $mes = "Prιcιdent";
> $query = " SELECT ID, NOM
> FROM adresse
> WHERE (nom < '$last_nom') OR (nom =
>'$last_nom' AND id > $last_id)
> ORDER BY nom DESC, id DESC LIMIT 1";
>
> extract(mysql_fetch_array(mysql_query($query)));
> }
>..
>
>..
><Form action...
><input type="image" src="images/co_arriere.png"
>name="arriere">
><input type="image" src="images/co_avant.png"
>name="avant">
>..
></Form>
>..
>
Navigation:
[Reply to this message]
|