Insert text automatic into content table

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
gacon
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun May 21, 2006 7:41 pm
Contact:

Insert text automatic into content table

Post by gacon » Fri Oct 26, 2007 12:07 pm

Hello all,

I would like to insert automatic some text into content table of DB of Joomla. Could you please tell me is this code is good? Do i should modify other things?

Thanks,

Code: Select all


$created_by = 65;
$datum=date("Y-m-d");
$publishdate = $datum;
$publishdate_readable =  $datum;

@mysql_query("
				INSERT INTO jos_content (
					title,
					introtext,
					`fulltext`,
					state,
					sectionid,
					mask,
					catid,
					created,
					created_by,
					checked_out,
					publish_up,
					attribs,
					version,
					access,
					ordering
				) VALUES (
					'". $titletext ."',
					'". $introtext ."',
					'". $maintext ."',
					'1',
					'".$sectionid."',
					'0',
					'".$catid."',
					'".$publishdate ."',
					'".$created_by."',
					'0',
					'". $publishdate ."',
					'introtext=0
					createdate=1',
					'1',
					'0',
					'1'
				)
			",$obj_db)



Ý Nghĩa . com http://www.ynghia.com/

Post Reply