php - Mysql failure to Table connection -


i want connection mysql database table. whole time failure.

the code table looks this:

 $sql_befehl = "create table if not exists beitrag (       id        int auto_increment primary key,       name      varchar(30),       email     varchar(70),       hp        varchar(70),       ip        varchar(16),       zeit      int(11),       beitrag   text,       kommentar text     )";  if (mysql_query($sql_befehl)) {       echo "success<br>" ;       } else {       echo "failure: <br>" ;     } 

hope can me.

if creating connection using pdo object, can use:

echo $dbc->getattribute(pdo::attr_connection_status) . "\n";

example:

define('db_host', '127.0.0.1'); define('db_name', 'db_name'); define('db_user', 'db_user'); define('db_pass', 'db_pass);   $dbc = new pdo('mysql:host='. db_host .';dbname='. db_name, db_user, db_pass);  echo $dbc->getattribute(pdo::attr_connection_status) . "\n";  $drop_table = "drop table if exists beitrag";  $dbc->exec($drop_table);  $create_table = 'create table if not exists beitrag (   id        int auto_increment primary key,   name      varchar(30),   email     varchar(70),   hp        varchar(70),   ip        varchar(16),   zeit      int(11),   beitrag   text,   kommentar text )';  $dbc->exec($create_table); 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -