Problem with PhP - SQL query

From: Date: Tue, 17 Jan 2017 15:25:08 +0000
Subject: Problem with PhP - SQL query
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-25493@lists.php.net to get a copy of this message
Hello, I have a problem with my php code. I hope you will answer ! I'm working for my Baccalauréat exam and this code is very important. I'm trying to creating an SQL table and the name of this table is a text imported from another page with the POST method, and the problem seems to be in the local variable I'm trying to include in the sql query: <?php $a = $_POST['auteur']; try { $bdd = new PDO('mysql:host=***;dbname=***','***','***'); } catch(Exception $e) { die('Erreur : '.$e->getMessage()); } $query = "CREATE TABLE IF NOT EXISTS $a ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY)"; header("Location: Gestion Catalogue.php/"); ?> Please I do need your help ! -- Arthur CARVALHO +33 6 30 81 11 78 arthur.carvalho2960@gmail.com

« previous php.webmaster (#25493) next »