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

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -