Re: [PHP] Encoding problem with command line PHP.exe

2002-07-12 Thread Analysis & Solutions

Emile:

On Fri, Jul 12, 2002 at 09:58:53PM +0100, Emile Axelrad wrote:

> $data = mssql_result(mssql_query("SELECT Field FROM table WHERE
> ID='1'"),0);
> mysql_insert("INSERT INTO table2 VALUES('$data')");

Ouch. 

First, you're mixing and matching mssql and mysql functions.  Second,
there is no function named mysql_insert().  Third, mssql_result() requires
three arguments, you only provided two.  Fourth, if you mean to be calling
mysql_result(), I've never seen folks call it with a mysql_query()  
function in it, people usually call the query function separately first
and put the resource identifier into a variable.  Fifth, all of this could
be thrown off by your retyping the example rather than copying/pasting or 
importing the acutal script that's giving you the error.  Sixth, you 
posted the same question twice.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Encoding problem with command line PHP.exe

2002-07-12 Thread Emile Axelrad

Hello - My problem is as follows:

 
The data in the MSSQL table is: Æã
 
 
IF I call this PHP code from my browser (IE6) it results in the
following output:
Æã
and it also places into the MySQL database the value: Æã
 
However, if I call this PHP code from the command line, using "php.exe
test.php" it also results in the following output:
Æã
but it places into the MySQL database: ’Æ
 
Does anyone have any idea why this is happening? I am sure it is a
character set issue, but for the life of me I cannot work out why the
command-line does not run the exact same script in the same way as a
browser would?
 
Regards,
Emile Axelrad,  
[EMAIL PROTECTED]



[PHP] Encoding problem with command line PHP.exe

2002-07-12 Thread Emile Axelrad

Hello - My problem is as follows:

 
The data in the MSSQL table is: Æã
 
 
IF I call this PHP code from my browser (IE6) it results in the
following output:
Æã
and it also places into the MySQL database the value: Æã
 
However, if I call this PHP code from the command line, using "php.exe
test.php" it also results in the following output:
Æã
but it places into the MySQL database: ’Æ
 
Does anyone have any idea why this is happening? I am sure it is a
character set issue, but for the life of me I cannot work out why the
command-line does not run the exact same script in the same way as a
browser would?
 
Regards,
Emile Axelrad,  
[EMAIL PROTECTED]