Creating table with variable name php mysql -


i'am trying create table variable name , columns via forms here's query

$execute =  mysql_query('create table '.$tname.'(             '.$cname.' '.$ctype.' )'); 

and it's creating table name variable $tname doesnt create columns.

try this:

$sql= "create table $tname($cname $ctype(45),$cname $ctype(50))";  //echo $sql; $op =mysql_query($sql); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -