I want to create a table by the name of the number that user creates. So what I wrote as the Postgres query is
$sql = 'CREATE TABLE '.$rNumber.'_Bus_Stops(
id serial primary key,
name character varying,
x double precision,
y double precision
);';
I'm getting this error.
Warning: pg_query(): Query failed: ERROR: syntax error at or near "11" LINE 1: CREATE TABLE 11_Bus_Stops( ^ in C:\wamp\www\cdap4\route1.php on line 138
Tried the same with double quotes as well. It does not work. Can someone help? It works totally fine if I remove $rNumber
$sql = "CREATE TABLE ".$rNumber."_Bus_Stops ( id int NOT NULL, name char(50) NOT NULL,x double,y double,CONSTRAINT ".$rNumber."_Bus_Stops PRIMARY KEY (id) );";