Jump to content

Archived

This topic is now archived and is closed to further replies.

realits

executing a variable query

Recommended Posts

hi all,

am trying to execute a query which has been generated from variables, here is the query :

mysql_query ("INSERT INTO `reportbase_data` (`series`,`sex`,`year`,`teacher`,`firstname`,`surname`,`psessions`,`attpercent`,`uabsence`,`ART1`,`ART2`,`ART3`,`ART4`,`ART5`,`ARTeff`,`ARTatt`,`ARTt1`,`ARTt2`,`ARTt3`,`DT1`,`DT2`,`DT3`,`DT4`,`DT5`,`DTeff`,`DTatt`,`DTt1`,`DTt2`,`DTt3`,`GEOG1`,`GEOG2`,`GEOG3`,`GEOG4`,`GEOG5`,`GEOGeff`,`GEOGatt`,`GEOGt1`,`GEOGt2`,`GEOGt3`,`HIS1`,`HIS2`,`HIS3`,`HIS4`,`HIS5`,`HISeff`,`HISatt`,`HISt1`,`HISt2`,`HISt3`,`ICT1`,`ICT2`,`ICT3`,`ICT4`,`ICT5`,`ICTeff`,`ICTatt`,`ICTt1`,`ICTt2`,`ICTt3`,`LIT1`,`LIT2`,`LIT3`,`LIT4`,`LIT5`,`LITeff`,`LITatt`,`LITt1`,`LITt2`,`LITt3`,`LITRE1`,`LITRE2`,`LITRE3`,`LITRE4`,`LITRE5`,`LITREeff`,`LITREatt`,`LITREt1`,`LITREt2`,`LITREt3`,`LITWR1`,`LITWR2`,`LITWR3`,`LITWR4`,`LITWR5`,`LITWReff`,`LITWRatt`,`LITWRt1`,`LITWRt2`,`LITWRt3`,`MU1`,`MU2`,`MU3`,`MU4`,`MU5`,`MUeff`,`MUatt`,`MUt1`,`MUt2`,`MUt3`,`NUM1`,`NUM2`,`NUM3`,`NUM4`,`NUM5`,`NUMeff`,`NUMatt`,`NUMt1`,`NUMt2`,`NUMt3`,`PE1`,`PE2`,`PE3`,`PE4`,`PE5`,`PEeff`,`PEatt`,`PEt1`,`PEt2`,`PEt3`,`PSD1`,`PSD2`,`PSD3`,`PSD4`,`PSD5`,`PSDeff`,`PSDatt`,`PSDt1`,`PSDt2`,`PSDt3`,`RE1`,`RE2`,`RE3`,`RE4`,`RE5`,`REeff`,`REatt`,`REt1`,`REt2`,`REt3`,`SCI1`,`SCI2`,`SCI3`,`SCI4`,`SCI5`,`SCIeff`,`SCIatt`,`SCIt1`,`SCIt2`,`SCIt3`,`hdcomment`,`tchcomment`) VALUES ('test2006','Male','Year 3','Marc Probert','Jonny','Cash','100','80','20','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','Jonny has been very good this year.','He has shown excellent progress.','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');");

the query works fine if i manually insert it into the code as above. However if $code is equal to the query above and i insert $code into my php it does nothing.

Can anyone help ???

Share this post


Link to post
Share on other sites
Try something along the lines of

[code]mysql_query("QUERY HERE") or die(mysql_error());[/code]

This should output any errors and help you identify the problem

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.