|
PostgreSQL |
MySQL |
|
|
$connection_id = pg_connect(“host=$hostname dbname=$database user=$username password=$password”); |
$connection_id=mysql_pconnect($hostname, $username, $password); |
Connection |
|
$result_data = pg_exec($connection_id, “query goes here”); |
$result_data = mysql_query(“query goes here”, $connection_id); |
Query |
|
$rslt=pg_exec($connection_id, “SELECT * from blah”); |
$rslt=mysql_query(“SELECT * FROM blah”, $connection_id); |
Fetching Data |
|
function postg_insert_id($tablename, $fieldname){ |
mysql_insert_id() |
The row ID of last inserted row |
|
CREATE TABLE practicetable{ |
CREATE TABLE practicetable( |
Auto Increment |
|
pg_numrows($result) |
mysql_num_rows($result) |
PHP Functions |
MySQL vs PostgreSQL (Coding)
هذه التدوينة كُتبت في التصنيف غير مصنف. أضف الرابط الدائم إلى المفضلة.