本文整理汇总了PHP中mysql_start函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_start函数的具体用法?PHP mysql_start怎么用?PHP mysql_start使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_start函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_start
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
#session_start();
require_once '/var/www/bais.islamiconlineuniversity.com/bais/config.php';
//require_once('/home/eomanico/public_html/ecampus/config.php');
require_once $CFG->dirroot . '/course/lib.php';
require_once $CFG->dirroot . '/lib/blocklib.php';
//unset($_SESSION['sch_page_name']);
include "centerconn.php";
include "php_lib3/misc.php";
include "php_lib3/mysql.php";
$mysql_connect_id = mysql_start($mysql_server, $center_db, $mysql_username, $mysql_password);
?>
<link rel="stylesheet" href="CenterCMS.css" /><link rel="shortcut icon" href="http://bais.islamiconlineuniversity.com/bais/theme/ingenuous/favicon.ico" /><style type="text/css">
.class6{
text-align: justify;
font-size:15px;
font-family: times new roman;
}
ul {
list-style-image:url('http://bais.islamiconlineuniversity.com/bais/center/buttons/sqpurple.gif');
}
.class2{
font-size:15px;
font-family: times new roman;
}
#page_header{
width: 750px;
margin-right: auto;
示例2: stripslashes_deep
}
}
}
return $array_temp;
}
}
# PHP Manual - Magic Quotes : Disabling Magic Quotes
if (get_magic_quotes_gpc() and !$magic_quotes_cleared) {
$FORM = stripslashes_deep($FORM);
// $_GET = undoMagicQuotes($_GET);
// $_POST = undoMagicQuotes($_POST);
// $_COOKIE = undoMagicQuotes($_COOKIE);
// $_REQUEST = undoMagicQuotes($_REQUEST);
}
#$sql_debug = 1;
$mysql_connect_id = mysql_start($mysql_server, $database_name, $mysql_username, $mysql_password);
if (!$mysql_connect_id) {
print "Unable to Connect to DB<br>" . mysql_error();
exit;
}
#$FORM['return_query'] = ( $FORM['return_query'] ) ? "?" . $FORM['return_query'] : "";
$FORM['return_query_mark'] = $FORM['return_query'] ? "?" . preg_replace("/^\\?+/", "", $FORM['return_query']) : "";
if ($FORM['submit']) {
if ($FORM['f'] == "add" and !$no_add) {
$table_structure = mysql_table_structure($mysql_connect_id, $table_name);
$primary_key_field = mysql_primary_key_field($table_structure);
foreach ($FORM['fieldz'] as $field_name => $value) {
if (is_array($value)) {
$add_fields[$field_name] = join(",", $value);
} else {
if ($trim_fields) {
示例3: mysql_start
<?php
include "cfg.php";
include "php_lib3/misc.php";
include "php_lib3/mysql.php";
@(include "../lang/en_utf8/countries.php");
$mysql_connect_id = mysql_start($mysql_server, $moodle_db, $mysql_username, $mysql_password);
$sqlCountry = mysql_query("select distinct(`country`) as country from `mdl_user` where country<>'' and country is not null order by country");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="http://bais.islamiconlineuniversity.com/bais/theme/standard/styles.php" />
<link rel="stylesheet" type="text/css" href="http://bais.islamiconlineuniversity.com/bais/theme/ingenuous/styles.php" />
<meta name="description" content="" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="http://bais.islamiconlineuniversity.com/bais/theme/standard/styles_ie7.css" />
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="http://bais.islamiconlineuniversity.com/bais/theme/standard/styles_ie6.css" />
<![endif]-->
<meta name="keywords" content="moodle, Islamic Online University - BAIS " />
<title>Islamic Online University - BAIS</title>
<link rel="shortcut icon" href="http://bais.islamiconlineuniversity.com/bais/theme/ingenuous/favicon.ico" />
<!--<style type="text/css">/*<![CDATA[*/ body{behavior:url(http://bais.islamiconlineuniversity.com/bais/lib/csshover.htc);} /*]]>*/</style>-->
<style type="text/css">
<!--
body {
font-family: Arial;
font-size: 10pt;
示例4: input_safe
<?php
include 'lib/includeall.php';
input_safe('null');
if (isset($_REQUEST["username"])) {
$p_username = $_REQUEST["username"];
} else {
die("One of the fields has not been set, please try again.");
}
if (isset($_REQUEST["password"])) {
$p_password = $_REQUEST["password"];
} else {
die("One of the fields has not been set, please try again.");
}
$createip = $_SERVER["REMOTE_ADDR"];
$con = mysql_start();
if (logonCheck($p_username, $p_password)) {
echo "Logon successful<br />";
echo print_r($_SESSION);
} else {
echo "Logon error, invalid username or password";
}
page_done($con);
示例5: mysql_generate_edit_form
function mysql_generate_edit_form($connection_parameters, $table_name, $display_fields = array(), $fields_to_display_properties = array(), $form_properties = array())
{
global $show_output_code;
# in order to bring in html to be printed, change '"' to '\"', '$' to '\$', and then regexp '\r\n([^\r\n]+)' to '\r\n $php_code .= "$1\\r\\n";'
$php_code = "<?php\r\n";
if (!$form_properties['single_page']) {
$php_code .= " include( \"../../php_lib3/misc.php\" );\r\n";
$php_code .= " include( \"../../php_lib3/misc_categories.php\" );\r\n";
$php_code .= " include( \"../../php_lib3/mysql.php\" );\r\n\r\n";
}
if (is_array($connection_parameters)) {
$connect_id = mysql_start($connection_parameters['mysql_server'], $connection_parameters['database_name'], $connection_parameters['mysql_username'], $connection_parameters['mysql_password']);
if (!$form_properties['single_page']) {
$php_code .= " \$mysql_server = \"{$connection_parameters['mysql_server']}\";\r\n";
$php_code .= " \$mysql_username = \"{$connection_parameters['mysql_username']}\";\r\n";
$php_code .= " \$mysql_password = \"{$connection_parameters['mysql_password']}\";\r\n\r\n";
$php_code .= " \$database_name = \"{$connection_parameters['database_name']}\";\r\n";
}
$php_code .= " \$table_name = \"{$table_name}\";\r\n";
$php_code .= " \$mysql_connect_id = mysql_start( \$mysql_server, \$database_name, \$mysql_username, \$mysql_password );\r\n\r\n";
$current_database = $connection_parameters['database_name'];
} else {
$connect_id = $connection_parameters;
$current_database = mysql_current_databse($connect_id);
$connection_parameters['database_name'] = $current_database;
$php_code .= " \$database_name = \"{$current_database}\";\r\n";
$php_code .= " \$table_name = \"{$table_name}\";\r\n\r\n";
}
$form_field_group_name = $form_properties['form_field_group_name'] ? $form_properties['form_field_group_name'] : "fieldz";
$table_structure = mysql_table_structure($connect_id, $table_name);
$fields_to_display = array_keys($table_structure);
$primary_key_field = mysql_primary_key_field($table_structure);
if ($display_fields['on']) {
foreach ($display_fields['on'] as $value) {
if ($table_structure[$value]) {
# verifies that the field is actually in the table
$fields_to_display1[] = $value;
}
}
$fields_to_display = $fields_to_display1;
} else {
if ($display_fields['off']) {
foreach ($display_fields['off'] as $value) {
$find_key = array_search($value, $fields_to_display);
if ($find_key !== False) {
unset($fields_to_display[$find_key]);
}
}
} else {
$all_fields = 1;
}
}
if ($display_fields['hide']) {
foreach ($display_fields['hide'] as $value) {
if ($table_structure[$value]) {
# verifies that the field is actually in the table
$fields_to_hide[] = $value;
}
}
$fields_to_hide1 = ",`" . join("`,`", $fields_to_hide) . "`";
}
if ($all_fields) {
$fields = "*";
} else {
$fields = "`" . join("`,`", $fields_to_display) . "`";
if (!is_array($fields_to_hide)) {
$fields_to_hide = array();
}
if (!in_array($primary_key_field, $fields_to_display) and !in_array($primary_key_field, $fields_to_hide)) {
# primary key wasnt found in the lists
$fields_to_hide1 .= ",`{$primary_key_field}`";
}
}
if (!$form_properties['single_page']) {
$php_code .= " \$table_structure = mysql_table_structure( \$mysql_connect_id, \$table_name );\r\n";
//$php_code .= " \$primary_key_field = mysql_primary_key_field( \$table_structure );\r\n\r\n";
$php_code .= " \$filter_field_names = array_keys( \$table_structure );\r\n";
$php_code .= " \$sql_field_names = \"{$fields}{$fields_to_hide1}\";\r\n";
$php_code .= " #\$sql_field_names = array_keys( \$table_structure );\r\n";
$php_code .= " \$primary_key_field = \"{$primary_key_field}\";\r\n\r\n";
}
$php_code .= " if ( \$FORM['submit'] ) {\r\n";
$php_code .= " if ( \$FORM['f'] == \"add\" ) {\r\n";
$php_code .= " foreach ( \$FORM['{$form_field_group_name}'] as \$field_name => \$value ) {\r\n";
$php_code .= " if ( is_array(\$value) ) {\r\n";
$php_code .= " \$add_fields[\$field_name] = join( \",\", \$value );\r\n";
$php_code .= " } else {\r\n";
$php_code .= " #if ( trim(\$value) ) {\r\n";
$php_code .= " \$add_fields[\$field_name] = trim(\$value);\r\n";
$php_code .= " #}\r\n";
$php_code .= " }\r\n";
$php_code .= " }\r\n\r\n";
$php_code .= " \$query_result = mysql_add_record( \"\", \$table_name, \$add_fields );\r\n\r\n";
$php_code .= " if ( !\$query_result ) {\r\n";
$php_code .= " print \"Error Adding Record\";\r\n";
$php_code .= " print mysql_info();\r\n";
$php_code .= " print mysql_error();\r\n";
$php_code .= " exit;\r\n";
$php_code .= " }\r\n";
$php_code .= " } else if ( \$FORM['f'] == \"edit\" ) {\r\n";
//.........这里部分代码省略.........