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
Add File EnKhBQSVjBe UYyWPpchXaqsyAYnvwY Euro Pop
images.jpg (edit delete) eaf asgf Rock
Add File testeCampo1 testeCampo2 Trance
sdg (edit delete) sdg sdg Pop
Add File -- -- Country
Add File -- -- Rock
testeCampo1 (edit delete) testeCampo2 testeCampo3 Trance
ggg (edit delete) gg ggg  -- 
Add File 5489 48974*/8 Trance
vxcv (edit delete) xcv xcv Rock
Add File bvnvbnnv nvnvnvn Rock
Add File cvbcvb oii Rock
Add File ccbvvvvv rfff44444 Country
Add File fff ll Rock
Add File -- -- Rock
Add File -- -- Rock
Add File -- -- Rock
Add File -- -- Euro Pop
Add File -- -- Rock
sfds (edit delete) dfsdfsdf sdfsf Country

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

 

"Brilliant. Saved insane amounts of time. `nuff said."
~Soule

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