Re: [PHP-DB] can u help me in PHP

2007-01-30 Thread Sergiu Voicu
It seems that there is no mysqli extension for PHP4. Read this thread at 
MySQL forums:

http://forums.mysql.com/read.php?52,83780,83780#msg-83780

Rana wrote:

Hello

 


I read ur reply on newsreader abou mysqli and if i can use it in PHP4

 


My question is where can i find a link to download the mysqli extension
separately without changing to PHP5

 


Please reply

 

Thank you 

 


Regards

Rana 

 





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] What effects MySQL connection's character set

2007-01-30 Thread Niel Archer
Hi Chris.

  Thanks for this. That page didn't actually help, but one of the follow
ups did.  Apparently, despite being setup as UTF-8 throughout the Db,
tables, and columns.  The returned data still can default to Latin1.
  I've forced my test server to return UTF-8 (I hope) and am trying it
out today. Fingers crossed!

Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread John L. Creed
Here's what I did wih your help:

function isAutoinc($table,$fieldname){
 // returns 0 if false, 1 if true
 $breturn = 0;
 $sql = "SHOW COLUMNS FROM $table LIKE '$fieldname%' ";
   $result = mysql_query($sql) or die("Couldn't open table");
 // check column Extra
   $row = mysql_fetch_array( $result );
   if( $row["Extra"] == "auto_increment" ){
 $breturn = 1;
   }
   mysql_free_result($result);
   return $breturn;
}

Thanks again!!!

-- 
Regards,
John L. Creed
pcExpressWay Consulting
*
dBASE Gold Charter Member 210
*
http://www.pcexpressway.com
*
"Niel Archer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi
>
> Try using:
> SHOW COLUMNS FROM db.table LIKE 'field_name%'
>
> and from the returned row, check the 'Extra' column for 'auto_increment'
>
> Niel 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] What effects MySQL connection's character set

2007-01-30 Thread Niel Archer
Hi

>   Thanks for this. That page didn't actually help, but one of the follow
> ups did.  Apparently, despite being setup as UTF-8 throughout the Db,
> tables, and columns.  The returned data still can default to Latin1.
>   I've forced my test server to return UTF-8 (I hope) and am trying it
> out today. Fingers crossed!

  That turned out to be overly optimistic.  Even Though the server is
using UTF-8 throughout, it still defaults to latin1 on connections.  So
I used the SET NAMES utf8. It still will not work as I expect.  I used
the following code to test it.

$Db = new mysqli($Host, $User, $Pass, $Db);

$Db->query("SET NAMES utf8");
$result = $Db->query("SHOW VARIABLES LIKE 'character\_set\_%'");

$count = $result->num_rows;
while ($count):
$dummy = $result->fetch_assoc();
print $dummy['Variable_name'] . " = " . $dummy['Value'] . "\n";
--$count;
endwhile;

print "\ncharacter_set_name: " . $Db->character_set_name() . "\n";

Which results in the following output:

character_set_client = utf8
character_set_connection = utf8
character_set_database = utf8
character_set_results = utf8
character_set_server = utf8
character_set_system = utf8

character_set_name: latin1

  I can't find any documentation on PHP's character encoding, beyond the
default_charset directive.  Several of the functions/extensions have
documentation, but not PHP itself.
  I suspect the problem is with php itself or the mysqli extension,
which was my original thought and reason for my post.

  Anyone have any ideas?


Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread Niel Archer
Hi John,

I'd suggest searching within the Extra field instead of testing for the
value explicitly, as this field can theoretically hold several extra
pieces of information.

Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php