[PHP-DB] Problem with SQL Server.
Hello, I'm working with a DB SQL Server. This DB has a table with Japanese characters. When I read a field (with Japanese characters) with function mssql_fetch_array(), always it return characters '?'. If I put 'print("(Japanese characters)");', these Japanese characters are shown correctly. My PHP file has follow code to work with Japanese characters: mb_internal_encoding("EUC-JP"); mb_http_output("EUC-JP"); mb_http_input("EUC-JP"); mb_language("Japanese"); My question: How can I show correctly the Japanese characters from a SQL Server DataBase? Thanks very much! Juan Torres. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Problem with SQL Anywhere 5.5 and PHP ODBC
Hi everybody, i have a problem with php 4.0 an Sql Anywhere 5.5. The Webserver (Apache), the database and PHP are all installed on the same server( win 2000). PHP is using ODBC to connect to the database. This works if no other programm using the ODBC-connection ! If i start a programm that use the ODBC-connection BEFORE i access a website that use the PHP-ODBC-connection to the database and then try to load a website that use the PHP-ODBC-connection i get the following error : Warning: odbc_connect(): SQL error: [Sybase][ODBC Driver]Unable to connect to database server: database engine not running, SQL state 08001 in SQLConnect in c:\programme\apache group\apache\htdocs\umka.php on line 29 I have tried to use another OBDC datasource name but the error is the same !! Can anybody help me ? I no that this must run, because i have installed the configuration 2 years before ( wiht php3) ! Paul Ciba [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with SQL
Most likely the datatype you are using for the id field is tinyint, auto increment. The tinyint datatype only goes to 127, so once you get to 127, it tries to assign the same value for the next one. Try changing your id datatype to int. HTH Maureen Brtosz Matosiuk <[EMAIL PROTECTED]> said: > Hi all > SQL gives me a strange error and I can't find any info about it. Mayby > someone of you could give me a clue what is wrong. > > The error is : 'Duplicate entry '127' for key 1' > Thanks for any help > -- > -= MAdSiuK ([EMAIL PROTECTED]) =- > "(...) jestesmy nihilistami, w nic nie wierzymy, doslownie w nic(...)" > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Problem with SQL
hi It is trying to insert the value '127' into a key field (or indexed field) when it already has a record with '127' in that field. You may know it as a key violation It means you are trying to insert a record with a duplicate primary key HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net tel. 0121-242-1473 --- -Original Message- From: Brtosz Matosiuk [mailto:[EMAIL PROTECTED]] Sent: 08 September 2002 10:22 To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem with SQL Hi all SQL gives me a strange error and I can't find any info about it. Mayby someone of you could give me a clue what is wrong. The error is : 'Duplicate entry '127' for key 1' Thanks for any help -- -= MAdSiuK ([EMAIL PROTECTED]) =- "(...) jestesmy nihilistami, w nic nie wierzymy, doslownie w nic(...)" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Problem with SQL
Hi all SQL gives me a strange error and I can't find any info about it. Mayby someone of you could give me a clue what is wrong. The error is : 'Duplicate entry '127' for key 1' Thanks for any help -- -= MAdSiuK ([EMAIL PROTECTED]) =- "(...) jestesmy nihilistami, w nic nie wierzymy, doslownie w nic(...)" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Problem with SQL query on several tables
> > Thanks, > > but I want wo JOIN data from three tables and then to order > > all data by "datestamp". There must be more than one column called datestamp, this is why mysql is telling you it's ambiguous. So you need to tell it which table's datestamp column you wish to use. for example your new query could be: select * from f1,f2,f3 order by f1.datestamp Also, presumably all the tables have a column which relates to one of the other columns in some way? If so, and I can't reason the point in doing it if there is not, maybe you should look at the JOIN syntax from the mysql manual. If nothing else it will give you a better understanding of joining tables and the problems you may face. M: > > Can I Do It ? > > > > Thanks, > > Rosen > > > > > > > > Andrey Hristov wrote in message > <071401c17759$f5873c80$0b01a8c0@ANDreY>... > > > >> Mysql says that in the join there are some columns with namer > datestamp so > > > > you have to choose by which you want to order. > > > >> Think about making LEFT JOIN. > >> select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field > LEFT JOIN f3 > > > > ON f2.some_field=f3.some_field roder by f1.datestamp; > > > >> Regards, > >> Andrey Hristov > >> IcyGEN Corporation > >> http://www.icygen.com > >> BALANCED SOLUTIONS > >> > >> > >> - Original Message - > >> From: "Rosen" <[EMAIL PROTECTED]> > >> To: <[EMAIL PROTECTED]> > >> Sent: Tuesday, November 27, 2001 5:34 PM > >> Subject: [PHP-DB] Problem with SQL query on several tables > >> > >> > >>> Hi, > >>> I'm trying to execute SQL query: > >>> "select * from f1,f2,f3 order by datestamp" > >>> > >>> MySQL returns me an error: > >>> "1052 - Column: 'datestamp' in order clause is ambigious" > >>> > >>> The tables f1,f2,f3 have some structure. > >>> The field "datestamp" is type datetime. > >>> > >>> Why I can't order query on 'datestamp' ? > >>> > >>> Thanks, > >>> Rosen > >>> > >>> > >>> > >>> -- > >>> PHP Database Mailing List (http://www.php.net/) > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > >>> To contact the list administrators, e-mail: > [EMAIL PROTECTED] > >>> > >>> > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with SQL query on several tables
It sounds to me like what you're trying to do is APPEND data from three similarly structured tables into one entity ordered by a column common to all 3 tables called "datestamp". If I'm mistaken, then please ignore all of the following: Approach #1 (mysql) Create a temporary table with the columns you need to process, indexed by "datestamp", and append the data from the 3 tables-- then query the temp table. Approach #2 (php) Create an associative array (hash table) in php then append the data from the 3 tables, order as desired, and process. Which you choose would depend on which you find simpler-- the mysql approach would probably take a more time, but be easier to reuse on successive pages. ib Rosen wrote: > Thanks, > but I want wo JOIN data from three tables and then to order > all data by "datestamp". > > Can I Do It ? > > Thanks, > Rosen > > > > Andrey Hristov wrote in message <071401c17759$f5873c80$0b01a8c0@ANDreY>... > >> Mysql says that in the join there are some columns with namer datestamp so > > you have to choose by which you want to order. > >> Think about making LEFT JOIN. >> select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field LEFT JOIN f3 > > ON f2.some_field=f3.some_field roder by f1.datestamp; > >> Regards, >> Andrey Hristov >> IcyGEN Corporation >> http://www.icygen.com >> BALANCED SOLUTIONS >> >> >> ----- Original Message - >> From: "Rosen" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Tuesday, November 27, 2001 5:34 PM >> Subject: [PHP-DB] Problem with SQL query on several tables >> >> >>> Hi, >>> I'm trying to execute SQL query: >>> "select * from f1,f2,f3 order by datestamp" >>> >>> MySQL returns me an error: >>> "1052 - Column: 'datestamp' in order clause is ambigious" >>> >>> The tables f1,f2,f3 have some structure. >>> The field "datestamp" is type datetime. >>> >>> Why I can't order query on 'datestamp' ? >>> >>> Thanks, >>> Rosen >>> >>> >>> >>> -- >>> PHP Database Mailing List (http://www.php.net/) >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> To contact the list administrators, e-mail: [EMAIL PROTECTED] >>> >>> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with SQL query on several tables
Thanks, but I want wo JOIN data from three tables and then to order all data by "datestamp". Can I Do It ? Thanks, Rosen Andrey Hristov wrote in message <071401c17759$f5873c80$0b01a8c0@ANDreY>... >Mysql says that in the join there are some columns with namer datestamp so you have to choose by which you want to order. >Think about making LEFT JOIN. >select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field LEFT JOIN f3 ON f2.some_field=f3.some_field roder by f1.datestamp; > >Regards, >Andrey Hristov >IcyGEN Corporation >http://www.icygen.com >BALANCED SOLUTIONS > > >- Original Message - >From: "Rosen" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Tuesday, November 27, 2001 5:34 PM >Subject: [PHP-DB] Problem with SQL query on several tables > > >> Hi, >> I'm trying to execute SQL query: >> "select * from f1,f2,f3 order by datestamp" >> >> MySQL returns me an error: >> "1052 - Column: 'datestamp' in order clause is ambigious" >> >> The tables f1,f2,f3 have some structure. >> The field "datestamp" is type datetime. >> >> Why I can't order query on 'datestamp' ? >> >> Thanks, >> Rosen >> >> >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with SQL query on several tables
Mysql says that in the join there are some columns with namer datestamp so you have to choose by which you want to order. Think about making LEFT JOIN. select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field LEFT JOIN f3 ON f2.some_field=f3.some_field roder by f1.datestamp; Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: "Rosen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 27, 2001 5:34 PM Subject: [PHP-DB] Problem with SQL query on several tables > Hi, > I'm trying to execute SQL query: > "select * from f1,f2,f3 order by datestamp" > > MySQL returns me an error: > "1052 - Column: 'datestamp' in order clause is ambigious" > > The tables f1,f2,f3 have some structure. > The field "datestamp" is type datetime. > > Why I can't order query on 'datestamp' ? > > Thanks, > Rosen > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Problem with SQL query on several tables
Hi, I'm trying to execute SQL query: "select * from f1,f2,f3 order by datestamp" MySQL returns me an error: "1052 - Column: 'datestamp' in order clause is ambigious" The tables f1,f2,f3 have some structure. The field "datestamp" is type datetime. Why I can't order query on 'datestamp' ? Thanks, Rosen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]