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:


FAQs

Questionno links please (you will be banned!)
Answerno links please (you will be banned!)...
Sort Order0
Action
Questionno links please (you will be banned!)
Answerno links please (you will be banned!)...
Sort Order0
Action
QuestionHaa haa haaHaa haa haa
AnswerHaa haa haaHaa haa haaHaa haa haa...
Sort Order1222
Action



Code to Create The Table Above:


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

$tblFAQ = new ajaxCRUD("FAQ", "tblFAQ", "pkFAQID");

#displays
$tblFAQ->displayAs("fldQuestion", "Question");
$tblFAQ->displayAs("fldAnswer", "Answer");
$tblFAQ->displayAs("fldSort", "Sort Order");

$tblFAQ->omitPrimaryKey();

#order by fldSort
$tblFAQ->addOrderBy("ORDER BY fldSort");

#set some textbox heights
$tblFAQ->setTextareaHeight('fldQuestion', 50);
$tblFAQ->setTextareaHeight('fldAnswer', 125);

#abbreviate the text for the display (no impact on edit)
$tblFAQ->formatFieldWithFunction("fldAnswer", "abbrivText");

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

#the callback function to abbreviate the answer text
function abbrivText($text){
	return substr($text, 0, 200) . "...";
}


 

"Thanks for the great script, you rock big time."
~Daniel

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