Feature 1244 resolved

Replace all mysql functions in core code by ones independant of database engine

Fix small php code synxtax : hash must be accessed with [ ] and not { }.

git-svn-id: http://piwigo.org/svn/trunk@4325 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2009-11-20 14:17:04 +00:00
parent c020cd0d7c
commit 924dd262ec
78 changed files with 789 additions and 691 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ $upgrade_description = 'Just a beginning test';
// | Upgrade content |
// +-----------------------------------------------------------------------+
list($now) = mysql_fetch_row(pwg_query('SELECT NOW()'));
list($now) = pwg_db_fetch_row(pwg_query('SELECT NOW()'));
echo
$now
."\n"
+1 -1
View File
@@ -66,7 +66,7 @@ $result = pwg_query($query);
$datas = array();
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$datas,
+1 -1
View File
@@ -47,7 +47,7 @@ $result = pwg_query($query);
$datas = array();
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$datas,
+1 -1
View File
@@ -68,7 +68,7 @@ SELECT id, keywords
WHERE keywords IS NOT NULL
;';
$result = pwg_query($query);
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
foreach(preg_split('/[,]+/', $row['keywords']) as $keyword)
{
+1 -1
View File
@@ -47,7 +47,7 @@ SELECT category_id, image_id
$result = pwg_query($query);
$datas = array();
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$datas,
+5 -5
View File
@@ -108,7 +108,7 @@ if ( !defined('PWG_CHARSET') )
SELECT language, COUNT(user_id) AS count FROM '.USER_INFOS_TABLE.'
GROUP BY language';
$result = pwg_query($query);
while ( $row=mysql_fetch_assoc($result) )
while ( $row=pwg_db_fetch_assoc($result) )
{
$language = $row["language"];
$lang_def = explode('.', $language);
@@ -141,7 +141,7 @@ SELECT language, COUNT(user_id) AS count FROM '.USER_INFOS_TABLE.'
SELECT language FROM '.USER_INFOS_TABLE.'
WHERE user_id='.$conf['webmaster_id'];
$result = pwg_query($query);
if (mysql_num_rows($result)==0)
if (pwg_db_num_rows($result)==0)
{
$query='
SELECT language FROM '.USER_INFOS_TABLE.'
@@ -150,7 +150,7 @@ SELECT language FROM '.USER_INFOS_TABLE.'
$result = pwg_query($query);
}
if ( $row=mysql_fetch_assoc($result) )
if ( $row=pwg_db_fetch_assoc($result) )
{
$admin_charset = $all_langs[$row['language']]['charset'];
}
@@ -165,7 +165,7 @@ SELECT language FROM '.USER_INFOS_TABLE.'
$all_tables = array();
$query = 'SHOW TABLES LIKE "'.$prefixeTable.'%"';
$result = pwg_query($query);
while ( $row=mysql_fetch_assoc($result) )
while ( $row=pwg_db_fetch_assoc($result) )
{
array_push($all_tables, $row[0]);
}
@@ -176,7 +176,7 @@ SELECT language FROM '.USER_INFOS_TABLE.'
$query = 'SHOW FULL COLUMNS FROM '.$table;
$result = pwg_query($query);
$field_definitions=array();
while ( $row=mysql_fetch_assoc($result) )
while ( $row=pwg_db_fetch_assoc($result) )
{
if ( !isset($row['Collation']) or $row['Collation']=='NULL' )
continue;
+1 -1
View File
@@ -60,7 +60,7 @@ $conf = $conf_save;
// +-Do I already have them in DB ?----------------------------------------+
$query = 'SELECT param FROM '.PREFIX_TABLE.'config';
$result = pwg_query($query);
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
unset( $params[ $row['param'] ] );
}
+1 -1
View File
@@ -47,7 +47,7 @@ $result = pwg_query($query);
$datas = array();
while ($row = mysql_fetch_assoc($result))
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$datas,