adamdidthis Posted January 25, 2007 Share Posted January 25, 2007 Where am I going wrong with this:[code]mysql_connect("localhost","root","")or die(mysql_error);mysql_select_db("joomla")or die(mysql_error);$result1 = mysql_query("SELECT * FROM pn_v4b_journal_journal")or die(mysql_error);while($row = mysql_fetch_array($result1)or die(mysql_error)){if (isset($row['jjo_image'])){$message = "<p><img height=\"38\" hspace=\"0\" src=\"images/stories/".$row['jjo_image']."></p>";}else{$message = $row['bodytext'];}$result2 = mysql_query("INSERT INTO jos_content (title, title_alis, introtext, fulltext, state, sectionid, mask, catid, created, created_by, created_by_alis, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parent_id, ordering, metakey, metadesc, access, hits) VALUES ("$row['jjo_title']","","","$message","1","3","0","10","$row['jjo_cr_date']","$row['jjo_owner_uid']","","$row['jjo_lu_date']","$row['jjo_lu_uid']","0","","","","","","allowcomments=0 showcomments=0","1","0","0","","","","0")")or die(mysql_error);}[/code]I keep getting:Parse error: parse error, unexpected T_VARIABLE in on line 17 Link to comment https://forums.phpfreaks.com/topic/35727-help-please/ Share on other sites More sharing options...
kenrbnsn Posted January 25, 2007 Share Posted January 25, 2007 You have quote problems on that line.Ken Link to comment https://forums.phpfreaks.com/topic/35727-help-please/#findComment-169306 Share on other sites More sharing options...
adamdidthis Posted January 26, 2007 Author Share Posted January 26, 2007 In what way are they wrong? I have tried different combinations of qoutes but can't seem to work it out.Any help will be greatly appreciatedCheers Link to comment https://forums.phpfreaks.com/topic/35727-help-please/#findComment-169514 Share on other sites More sharing options...
kenrbnsn Posted January 26, 2007 Share Posted January 26, 2007 Try it this way:[code]<?php$q = "INSERT INTO jos_content (title, title_alis, introtext, fulltext, state, sectionid, mask, catid, created, created_by, created_by_alis, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parent_id, ordering, metakey, metadesc, access, hits) VALUES ('{$row['jjo_title']}', '', '', '$message', '1', '3', '0', '10', '{$row['jjo_cr_date']}', '{$row['jjo_owner_uid']}', '', '{$row['jjo_lu_date']}', '{$row['jjo_lu_uid']}', '0', '', '', '', '', '','allowcomments=0 showcomments=0', '1', '0', '0', '', '', '', '0')";$result2 = mysql_query($q)or die("Problem with the query:<pre>$q</pre><br>" . mysql_error());?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/35727-help-please/#findComment-169520 Share on other sites More sharing options...
adamdidthis Posted January 26, 2007 Author Share Posted January 26, 2007 am now getting PHP Parse error: parse error, unexpected $ in /home/adamdidthis/journalimport.php on line 18 Link to comment https://forums.phpfreaks.com/topic/35727-help-please/#findComment-169524 Share on other sites More sharing options...
adamdidthis Posted January 26, 2007 Author Share Posted January 26, 2007 OK have sorted that but its now doing :Problem with the query:<pre>INSERT INTO jos_content (title, title_alis, introtext, fulltext, state, sectionid, mask, catid, created, created_by, created_by_alis, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parent_id, ordering, metakey, metadesc, access, hits) VALUES ('Line up', '', '', '<p><img height="38" hspace="0" src="images/stories/88986284dECkQq_ph.jpeg></p>', '1', '3', '0', '10', '2003-10-23 07:17:12', '14', '', '2003-10-23 21:50:47', '14', '0', '', '', '', '', '','allowcomments=0 showcomments=0', '1', '0', '0', '', '', '', '0')</pre><br>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext, state, sectionid, mask, catid, created, created_by, created_by_alis, m' at line 1[ Link to comment https://forums.phpfreaks.com/topic/35727-help-please/#findComment-169526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.