QUERY FAILED .You have an error in your SQL syntax; check the manual that corres
Résolu/Fermé
A voir également:
- You have an error in your sql syntax; check the manual that corresponds to your mariadb server version for the right syntax to u
- You have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use - Meilleures réponses
- Check the manual that corresponds to your mysql server version for the right syntax to use near - Meilleures réponses
- Erreur SQL syntax ✓ - Forum - MySQL
- QUERY FAILED .You have an error in your SQL syntax; check the manual that corres ✓ - Forum - MySQL
- You have an error in your SQL syntax ✓ - Forum - Webmaster
- #1064 - You have an error in your SQL syntax ✓ - Forum - MySQL
- Erreur : You have an error in your SQL syntax - Forum - Webmaster
5 réponses
yg_be
15 févr. 2021 à 12:15
- Messages postés
- 19516
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 26 juin 2022
15 févr. 2021 à 12:15
bonjour,
affiche (echo) la valeur de ta variable $query.
ensuite, utilise-la hors php, par exemple dans phpmyadmin.
si tu ne comprends pas le soucis, partage ici ce que contient cette variable.
affiche (echo) la valeur de ta variable $query.
ensuite, utilise-la hors php, par exemple dans phpmyadmin.
si tu ne comprends pas le soucis, partage ici ce que contient cette variable.
Voici ce qu'il affiche avec echo.
INSERT INTO posts (post_category_id, post_title, post_user, post_date, post_image, post_content, post_tags, post_status) VALUES(,'','',now(),'','','','') QUERY FAILED .
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''','',now(),'','','','')' at line 1
INSERT INTO posts (post_category_id, post_title, post_user, post_date, post_image, post_content, post_tags, post_status) VALUES(,'','',now(),'','','','') QUERY FAILED .
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''','',now(),'','','','')' at line 1
yg_be
15 févr. 2021 à 14:42
- Messages postés
- 19516
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 26 juin 2022
15 févr. 2021 à 14:42
es-tu satisfait des valeurs que tu essaies d'insérer?
VALUES(,'','',now(),'','','','')
Il manque la valeur post_ category_id, il ne l’a pris en compte alors que je l’ai bien défini .
$post_category_id = escape($_POST['post_category']);
$post_category_id = escape($_POST['post_category']);
yg_be
15 févr. 2021 à 15:18
- Messages postés
- 19516
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 26 juin 2022
15 févr. 2021 à 15:18
as-tu fait
et
ce sont des techniques assez habituelles pour comprendre le comportement d'un programme
echo $post_category_id
et
print_r($_POST)
ce sont des techniques assez habituelles pour comprendre le comportement d'un programme
c'est la fonction scape qui fait défaut, quand je l'ai enlevé ça a marché.
merci pour la suivie
merci pour la suivie
yg_be
15 févr. 2021 à 15:53
- Messages postés
- 19516
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 26 juin 2022
15 févr. 2021 à 15:53
pourras-tu, alors, marquer la discussion comme résolue?
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question