ajaxCRUD.com
» a PHP class to create / read / update / delete from a database table using AJAX
by loud canvas mediaQuick Links:
Quick Examples:
- Displaying Images
- Creating a Relationship
- File Uploading
- Using a Where Clause
- Defining Allowable Input
- Formatting a Field With a Function
- Show Header Checkbox
www.allthewebsites.org
Add Where Clause
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) );
| fldFilename | fldTitle | fldArtist | fldGenre |
|---|---|---|---|
| alex sintek | Pop | ||
| Pop | |||
| ad | sd | hola | Pop |
Class Implementation:
#include the class
include ('ajaxCRUD.class.php');
#this one line of code is how you implement the class
$tblDemo = new ajaxCRUD("MP3 File",
"tblMyMp3CollectionDemo", "pkMP3ID");
$tblDemo->omitPrimaryKey();
#add the sql where clause
$tblDemo->addWhereClause("WHERE fldGenre = 'Pop'");
$allowable_vals = array("Pop", "Rock", "Country", "Blues");
$tblDemo->defineAllowableValues("fldGenre", $allowable_vals);
#don't allow deleting of rows
$tblDemo->disallowDelete();
#actually show the table
$tblDemo->showTable();
View Example by Itself
Click here to view example outside of the template.
Recent Feedback
"Hello. And Bye." - Posted by XRumerTest on Sunday May 3rd, 2009 at 8:58pm
"Hello. And Bye." - Posted by XRumerTest on Monday May 4th, 2009 at 3:23am
"first of all: great work! thanx for this class!!
please give me a tip: when generating a new record i want to see the input form on top of the window. is this possible?!
have a nice weekend - i`m greeting from muenster - a town in the middel-west of germany. it rains.........
cordially,
wolga
" - Posted by wolga wibri on Friday May 8th, 2009 at 3:27am
please give me a tip: when generating a new record i want to see the input form on top of the window. is this possible?!
have a nice weekend - i`m greeting from muenster - a town in the middel-west of germany. it rains.........
cordially,
wolga
" - Posted by wolga wibri on Friday May 8th, 2009 at 3:27am
"Great post! I`ll subscribe right now wth my feedreader software!" - Posted by JaneRadriges on Saturday Jun 13th, 2009 at 11:34pm
"The best information i have found exactly here. Keep going Thank you" - Posted by KattyBlackyard on Monday Jun 15th, 2009 at 12:08am
"Todd Cowle Municipal Bond Credit Report synthesizes, analyzes and presents aggregate credit information and trends in the municipal bond market. The report includes municipal bond rating information from the three major rating agencies – Moody’s Investor Services, Standard and Poor’s and Fitch Ratings." - Posted by fuccembef on Wednesday Mar 17th, 2010 at 12:10am
"Hi
G`night" - Posted by Test on Tuesday May 18th, 2010 at 6:05am
G`night" - Posted by Test on Tuesday May 18th, 2010 at 6:05am
"Thank you very well read allss textt about drsating and ilike it very much" - Posted by cASPERSEANAELE on Thursday May 20th, 2010 at 7:50pm
"just wanted to say that this sites is realy great and Im Glad that i found it
I`ve gotten exposed to quite a lot of stuff here and just wanted to give my 7 cents. Im about to write a fine article for this forum about
and I`ll publish it as soon as i finish it.
If anybody need some support about it, please MSG me.
Thank you.
on the other hand : If you got problems with other stuff ,
you should read this article here:
It`s a good thing. ;)
cheers! " - Posted by unremoRoffLef on Thursday Jul 22nd, 2010 at 7:36am
I`ve gotten exposed to quite a lot of stuff here and just wanted to give my 7 cents. Im about to write a fine article for this forum about
and I`ll publish it as soon as i finish it.
If anybody need some support about it, please MSG me.
Thank you.
on the other hand : If you got problems with other stuff ,
you should read this article here:
It`s a good thing. ;)
cheers! " - Posted by unremoRoffLef on Thursday Jul 22nd, 2010 at 7:36am
Leave a Comment
"Great api. Really love the demo. "
~Ade
