ajaxCRUD.com

» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAX

   by loud canvas media

Quick Links:

Quick Examples:


File Upload Example


Consider the following table:

	CREATE TABLE tblMyMp3CollectionDemo(
	pkMP3ID INT PRIMARY KEY AUTO_INCREMENT,
	fldFilename VARCHAR(150),
	fldTitle VARCHAR(60),
	fldArtist VARCHAR(60),
	fldGenre VARCHAR(40)
	);


File uploading for this demo has been disabled due to repeated hacking attempts.


fldFilenamefldTitlefldArtistfldGenreAction
adszzxc (edit delete) -- cxz Pop
7.jpg (edit delete) fdfs safas HipHop
Add File -- -- Euro Pop
Add File adfasdfsadfas 1 yyy Euro Pop
Add File -- -- Pop
Add File -- -- Rock
Add File -- -- Pop
Add File sdxs asdds Euro Pop
Add File Hjjhjjj -- Country
Add File -- -- Euro Pop
Add File -- -- Rock
CS580-mockup.zip (edit delete) -- -- Rock
Add File asda adasdffff Euro Pop
Add File -- -- Rock
burnout_paradise_-_1_-_esrb_e_pegi_7+.jps (edit delete) testeCamkmpo2fdfdfdfddgggggggggggggggggggggggggggggggggggggg testeCampo3 Trance
Add File ads``dads``dads``dads``dads``dads``dads``dads``dads``dads``d qwerfdsfsqwerfdsfsqwerfdsfsqwerfdsfsqwerfdsfsqwe rfdsfsqwerf Blues
Add File gg ggg  -- 
02_RESUL_ESC_GRADO_ASIGNATURA.xls (edit delete) Escuelas\ -- Rock
Add File eeee eee Country
Add File ndsfsdf fsddf Rock
Add File cvbcvb oii Rock
Add File ccbvvvvv aaaa Country
Add File sdf asdf Rock
Add File asdasdadsad asdasdadadad Euro Pop
Add File -- -- Rock
1 (edit delete) 1 2 Country
Add File Ytrer -- Pop
Add File test -- Rock
Add File -- -- Pop
Add File -- -- Rock

Class Implementation:


#required file and class
require_once ('preheader.php');
include_once ('ajaxCRUD.class.php')

#this one line of code is how you implement the class
$tblDemo = new ajaxCRUD("MP3 File",
     "tblMyMp3CollectionDemo", "pkMP3ID");

$tblDemo->omitPrimaryKey();
$tblDemo->setFileUpload("fldFilename", "uploads/");

$allowable_vals = array("Rock", "Euro Pop", "Trance", "HipHop");
$tblDemo->defineAllowableValues("fldGenre", $allowable_vals);

#actually show to the table
$tblDemo->showTable();

View Example by Itself

Click here to view example outside of the template.

Recent Feedback

"OMG! This is just what I was looking for. Thanks so much. This is amazing!" - Posted by Simone on Friday Jul 11th, 2008 at 4:34pm

"Sorry all -- had to disable uploading due to hacking attempts. Feel free to try out on your own server though!" - Posted by Sean Dempsey on Sunday Sep 14th, 2008 at 7:23pm

"comment2, " - Posted by jonn2 on Sunday Nov 9th, 2008 at 6:21am

"awesome it is best
working fine
thanks
" - Posted by fakhru on Tuesday Dec 16th, 2008 at 5:28am

"ajaxCRUD.class.php on line 1238" - Posted by Juan Carlos on Monday Jan 19th, 2009 at 4:32pm

"just what i looked for..." - Posted by Sergey on Wednesday Mar 25th, 2009 at 11:02am

"I can`t wait to give this a try." - Posted by Fortin on Thursday Mar 26th, 2009 at 3:58pm

"I can`t wait to give this a try." - Posted by Fortin on Thursday Mar 26th, 2009 at 3:59pm

"Great Stuff !!

You Are Wonderful People

Thanks
" - Posted by Mark on Wednesday Oct 27th, 2010 at 10:23am

"There is a bug in the fileupload() when you try to upload big size file it just don`t upload and throw error " There was an error uploading your file (or none was selected)."...

Guy`s any one face the same error like i faced

--Alex
" - Posted by Alex on Monday Aug 1st, 2011 at 12:53pm

Leave a Comment

Your Name      
Your Email   
Comment

 

"Thanks a lot for all AjaxCRUD project. It makes my day... works like a charm!"
~jveyes

What is a business/commercial website?

A commercial website is one created for a business, for which purpose is generating revenue or cash flow of any type (and that isn't under a non-profit organization). So if you're selling a product, selling advertisement, selling a service, or just marketing a commercial business, your site is commercial. A company website is also commercial even if it doesn't sell anything, as it's purpose is to front a commercial company.
Close