Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[résolu]Question sur mysql_insert_id

Featured Replies

Posté(e)

Coucou,

Quand je fait un insert vers la bd, j'aurai aimé récupéré aussitôt le id, j'ai lus que mysql_insert_id récupérai le dernier enregistré, mais suposon qu''il y avait simultanément une autre personne qui fessait lui aussi une insertion dans la bd, est ce qu'il ne vas pas me récupéré le id d'un autre utilisateur?

Merci

Posté(e)

D'après le manuel :

int mysql_insert_id ( resource link_identifier )

mysql_insert_id retourne le dernier identifiant généré par un champ de type AUTO_INCREMENT, sur la connexion MySQL courante ou sûr la connexion spécifiée par link_identifier .

Donc si je comprends bien, en précisant la connexion dans le mysql_insert_id, ça va être le dernier ID utilisé par votre connexion, par exemple en PHP :

$id = mysql_insert_id($mysql_connexion);

A tester :transpi:

PS : $mysql_connexion serait la connexion MySQL ouverte précédemment

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.