|
Posted by Otto on 11/03/05 20:29
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
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>
...
[Back to original message]
|