Insert Update Delete view function using PHP and mysql – crud function

Insert Update Delete view function using PHP and mysql – crud function

In this Post We Will Explain About is Insert Update Delete view function using PHP and mysql – crud function With Example and Demo.Welcome on Live24u.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to mysql – how to simplify my php codeinsert, update and delete functionExample

In this post we will show you Best way to implement Insert Update Delete using PHP and mysql Code Example, hear for Basic insert, view, edit, delete and update using PHP and Mysqlwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

You can download source code and Demo from below link.




mysql_fetch_row

function db_fetch_row($data_results)
{

	return mysql_fetch_row($data_results);
}

mysql_fetch_assoc

function db_fetch_assoc($data_results)
{

	return mysql_fetch_assoc($data_results);
}

mysql_fetch_array

function all_db_fetch_data($data_results)
{

	return mysql_fetch_array($data_results);
}

mysql_data_seek

function db_seek_table(&$data_results,$record)
{
	return mysql_data_seek($data_results, $record);
}

mysql_free_data_results

function db_free_data_results($data_results)
{
	if ($data_results)
		mysql_free_data_results($data_results);
}

mysql_num_rows

function all_db_num_rows_toal($data_results)
{
	return mysql_num_rows($data_results);
}

mysql_num_fields

function my_db_num_fields_all($data_results)
{
	return mysql_num_fields($data_results);
}




mysql_query

function all_db_query_data($sql_query, $err_msg=null)
{
	global $databaseselect, $SysPrefs, $sql_query_queries, $Ajax, $databaseselect_db_connections, $get_last_mysql_id;

	// set simple current db prefix
	$datascomp = isset($_SESSION["client_uiser"]->cur_con) ? $_SESSION["client_uiser"]->cur_con : 0;
	$cur_prefix = $databaseselect_db_connections[$datascomp]['tbpref'];
	$sql_query = str_replace(TB_PREF, $cur_prefix, $sql_query);

	if ($SysPrefs->show_sql)
	{
		$Ajax->activate('footer_debug');
		$sql_query_queries .= "<pre>$sql_query</pre>\n<hr>";
	}

	db_profile(); // mysql profiling

	$retry = MAX_DEADLOCK_RETRY;
	do {
		$data_results = mysql_query($databaseselect, $sql_query);
		if (mysql_errno($databaseselect) == 1213)	{ 
			sleep(1); $retry--;
		} else
			$retry = 0;
	} while ($retry);

	db_profile($sql_query);

	if($SysPrefs->sql_trail) {
		$get_last_mysql_id = mysql_insert_id($databaseselect);
		if ($SysPrefs->select_trail || (strstr($sql_query, 'SELECT') === false)) {
			mysql_query(
			"INSERT INTO ".$cur_prefix."sql_trail
				(`sql`, `data_results`, `msg`)
				VALUES(".db_escape($sql_query).",".($data_results ? 1 : 0).",
				".db_escape($err_msg).")", $databaseselect);
		}
	}

	if ($err_msg != null || $SysPrefs->go_debug) {
		$exit = $err_msg != null;
		if (function_exists('xdebug_call_file'))
			$err_msg = '<br>At file '.xdebug_call_file().':'.xdebug_call_line().':<br>'.$err_msg;
		check_db_error($err_msg, $sql_query, $exit);
	}
	return $data_results;
}

mysql_errno

function db_error_no()
{
	global $databaseselect;
	return mysql_errno($databaseselect);
}

mysql_error

function db_error_msg($conn)
{
	return mysql_error($conn);
}




get_last_mysql_id

function db_insert_id()
{
	global $get_last_mysql_id, $SysPrefs, $databaseselect;

	return $SysPrefs->sql_trail ? $get_last_mysql_id : mysql_insert_id($databaseselect);
}

mysql_select_db

function db_create_db($db_connection)
{
	$databaseselect = mysql_connect($db_connection["host"] ,
		$db_connection["dbuser"], $db_connection["dbpassword"]);

	if (!mysql_select_db($db_connection["dbname"], $databaseselect))
	{
		$sql_query = "CREATE DATABASE IF NOT EXISTS `" . $db_connection["dbname"] . "`"
			. " DEFAULT COLLATE '" . get_mysql_collation($db_connection["collation"]) . "'";

		if (!mysql_query($sql_query) || !mysql_select_db($db_connection["dbname"], $databaseselect))
				return 0;
	} else
		if (!db_set_collation($db_connection["collation"], $databaseselect))
			return 0;

	return $databaseselect;
}

db_drop_db

function db_drop_db($db_connection)
{

	if ($db_connection["tbpref"] == "")
	{
		$sql_query = "DROP DATABASE IF EXISTS " . $db_connection["dbname"] . "";
		return mysql_query($sql_query);
	}
	else
	{
    	$result = all_db_query_data("show table status");
    	$fetch_all_tables = array();
    	while($row = db_fetch($result))
    		$fetch_all_tables[] = $row;
		foreach ($fetch_all_tables as $table)
		{
			if (strpos($table['Name'], $db_connection["tbpref"]) === 0)
				all_db_query_data("DROP TABLE `".$table['Name'] . "`");
		}
		return true;
	}
}

mysql_close

function db_close($databaseselectase = null)
{
	global $databaseselect;
	
	if (!$databaseselectase)
		$databaseselectase = $databaseselect;
	return mysql_close($databaseselectase);
}

function_exists

function data_db_extension_exists()
{
	return function_exists('mysql_connect');
}

Update record activity status.

function update_record_status($id, $status, $table, $key) {
	$sql_query = "UPDATE ".TB_PREF.$table." SET inactive = "
		. ((int)$status)." WHERE $key=".db_escape($id);
		
  	db_query($sql_query, "Can't update record status");
}

You can download source code and Demo from below link.





Example

I hope you have Got What is php insert update delete example download And how it works.I would Like to have FeadBack From My Blog(live24u.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(live24u.com) Are Most Always Welcome.

http://live24u.com/wp-content/uploads/2017/06/Insert-Update-Delete-view-function-using-PHP-and-mysql-crud-function-1024x576.jpghttp://live24u.com/wp-content/uploads/2017/06/Insert-Update-Delete-view-function-using-PHP-and-mysql-crud-function-150x150.jpgadminAjaxHtmlJavaScriptjQueryJSONMysqlMysqliPHPadd edit delete php mysql code,add edit delete php source code,Basic insert,delete and update using PHP and Mysql,Delete Record in Database Using PHP MySQL,edit,Insert,insert update delete in php in one form,insert update delete in php mysqli with example,insert update delete in php on same page,insert update delete in php with source code,Insert Update Delete using PHP and mysql Code Example,List,mysql - how to simplify my php codeinsert,php insert update delete example download,php mysql add edit delete same page,Select Insert Update Delete In Php MySQL Example. Add,update and delete function,UPDATE and DELETE with PDO,viewInsert Update Delete view function using PHP and mysql - crud function In this Post We Will Explain About is Insert Update Delete view function using PHP and mysql - crud function With Example and Demo.Welcome on Live24u.com - Examples, The best For Learn web development Tutorials,Demo with Example! Hi...BIGGEST AND FASTEST Web Tutorials - live24u.com