Copy CodeThe code is as follows:
Include ("adodb/adodb.inc.php"); Contains the ADODB class library file
$conn = newadoconnection (' mysql '); Connecting to a database
$conn, Connect (' localhost ', ' root ', ' 1981427 ', ' test ');
$conn, Execute ("INSERT into tablename1 values (' 9 ', ' Zhuzhao ', ' Simon ')"); Execute SQL
?>
Copy CodeThe code is as follows:
Include ("adodb/adodb.inc.php"); Contains the ADODB class library file
$conn = newadoconnection (' mysql '); Create a ADODB object that declares that the database type is MySQL
$conn->connect ("localhost", "root", "1981427", "Test"); Connect to the database, where MyDB is the database name
$sqle = $conn->execute ("INSERT into tablename1 values ('", ' Zhuzhao ', ' Simon ') "); Use $sqle to determine if SQL is performing successfully
if ($sqle)//If the execution succeeds, the output of the successful execution of the information
{
echo "SQL execution succeeded";
}
else//If execution fails, output error message
{
echo $conn->errormsg ();
}
?>
Copy CodeThe code is as follows:
Include ("adodb/adodb.inc.php"); Contains the ADODB class library file
$conn = newadoconnection (' mysql '); Create a ADODB object that declares that the database type is MySQL
$conn->connect ("localhost", "root", "1981427", "Test"); Connect to the database, where MyDB is the database name
$rs = $conn->execute ("SELECT * from tablename1"); Execute the SQL statement to save the result in the result set
if ($RS)//If execution succeeds, the output statement successfully executes the information
{
echo "statement execution succeeded";
}
else//If execution fails, output error message
{
echo $conn->errormsg ();
}
?>
Copy CodeThe code is as follows:
Include ("adodb/adodb.inc.php"); Contains the ADODB class library file
$conn = newadoconnection (' mysql '); Create a ADODB object that declares that the database type is MySQL
$conn->connect ("localhost", "root", "1981427", "Test"); Connect to the database, where MyDB is the database name
$rs = $conn->execute ("SELECT * from tablename1"); Execute the SQL statement to save the result in the result set
if ($RS)//If execution succeeds, loop read result set
{
while (! $rs->eof)//loop to read all records in $rs
{
Echo $rs->fields[0]. ' '. $rs->fields[1]. ' '. $rs->fields[2]. '
'; Output when moving forward
$rs->movenext (); Move the pointer to the next record
}
}
else//If execution fails, output error message
{
echo $conn->errormsg ();
}
?>
Copy CodeThe code is as follows:
Include ("adodb/adodb.inc.php"); Contains the ADODB class library file
$conn = newadoconnection (' mysql '); Create a ADODB object that declares that the database type is MySQL
$conn->connect ("localhost", "root", "1981427", "Test"); Connect to the database, where MyDB is the database name
$rs = $conn->execute ("SELECT * from tablename1"); Execute the SQL statement to save the result in the result set
if ($RS)//If execution succeeds, loop read result set
{
while (! $rs->eof)//loop to read all records in $rs
{
echo $rs->fields[' id ']. ' '. $rs->fields[' username '). ' '. $rs->fields[' password '). '
'; Output when moving forward
$rs->movenext (); Move the pointer to the next record
}
}
else//If execution fails, output error message
{
echo $conn->errormsg ();
}
?>
http://www.bkjia.com/PHPjc/320050.html www.bkjia.com true http://www.bkjia.com/PHPjc/320050.html techarticle Copy the code as follows: PHP include ("adodb/adodb.inc.php");//contains ADODB class library file $conn = newadoconnection (' mysql ');//Connect database $conn-conn ECT (' localhost ', ' root ',...