Reply to Re: PHP & MySQL skip problem

Your name:

Reply:


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>
>..
>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация