RE: [PHP-DB] MySQL query result with some errors!
The code looks correct so my guess is that you are parsing it inorrectly in actionscript... Bastien From: Juan Stiller <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] MySQL query result with some errors! Date: Tue, 11 Oct 2005 18:14:42 -0300 (ART) Hi, Im trying to get a query result from mysql database to show it on a flash animation, so far i have this code that its supposed to connect to mysql server , make the query and get the results, store them on variables so that flash can read them. Basically i have these main fileds like : lastname, firstname and so on... a guy here told me correctly that i should in case to have more than one entry on the database, use the output like lastname1, lastname2, etc. I gues this code is doing that, but when i want to show that info on flash i get eg: lastname: smithn=0 lastname: jacksonn=1 when it should be lastname: smith lastname: jackson ... ... So i guess im doing something wrong, can someone point me in the right direcction?? Here is the php code: No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("llamadas") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } $qr = mysql_query("select * from datos"); $nrows = mysql_num_rows($qr); $rString = "n=".$nrows; for ($i=0; $i < $nrows; $i++) { $row = mysql_fetch_array($qr); $rstring .= "&Id".$i."=".$row['id']; $rString .= "&Dia".$i."=".$row['dia']."&Mes".$i."=".$row['mes']."&Ano".$i."=".$row['ano']; $rString .= "&Hora".$i."=".$row['hora']."&Minutos".$i."=".$row['minutos']; $rString .= "&Receptor".$i."=".$row['receptor']. $rString .= "&Destinatario".$i."=".$row['destinatario']. $rString .= "&Apellido".$i."=".$row['apellido']. $rstring .= "&Nombre".$i."=".$row['nombre']; $rstring .= "&Telefono".$i."=".$row['telefono']; $rstring .= "&Asunto".$i."=".$row['asunto']; } echo $rString; mysql_free_result($qr); ?> Thanks. Juan ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- 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] MySQL query result with some errors!
Hi, Im trying to get a query result from mysql database to show it on a flash animation, so far i have this code that its supposed to connect to mysql server , make the query and get the results, store them on variables so that flash can read them. Basically i have these main fileds like : lastname, firstname and so on... a guy here told me correctly that i should in case to have more than one entry on the database, use the output like lastname1, lastname2, etc. I gues this code is doing that, but when i want to show that info on flash i get eg: lastname: smithn=0 lastname: jacksonn=1 when it should be lastname: smith lastname: jackson ... ... So i guess im doing something wrong, can someone point me in the right direcction?? Here is the php code: No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("llamadas") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } $qr = mysql_query("select * from datos"); $nrows = mysql_num_rows($qr); $rString = "n=".$nrows; for ($i=0; $i < $nrows; $i++) { $row = mysql_fetch_array($qr); $rstring .= "&Id".$i."=".$row['id']; $rString .= "&Dia".$i."=".$row['dia']."&Mes".$i."=".$row['mes']."&Ano".$i."=".$row['ano']; $rString .= "&Hora".$i."=".$row['hora']."&Minutos".$i."=".$row['minutos']; $rString .= "&Receptor".$i."=".$row['receptor']. $rString .= "&Destinatario".$i."=".$row['destinatario']. $rString .= "&Apellido".$i."=".$row['apellido']. $rstring .= "&Nombre".$i."=".$row['nombre']; $rstring .= "&Telefono".$i."=".$row['telefono']; $rstring .= "&Asunto".$i."=".$row['asunto']; } echo $rString; mysql_free_result($qr); ?> Thanks. Juan ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL query result with some errors!
Hi, Im trying to get a query result from mysql database to show it on a flash animation, so far i have this code that its supposed to connect to mysql server , make the query and get the results, store them on variables so that flash can read them. Basically i have these main fileds like : lastname, firstname and so on... a guy here told me correctly that i should in case to have more than one entry on the database, use the output like lastname1, lastname2, etc. I gues this code is doing that, but when i want to show that info on flash i get eg: lastname: smithn=0 lastname: jacksonn=1 when it should be lastname: smith lastname: jackson ... ... So i guess im doing something wrong, can someone point me in the right direcction?? Here is the php code: No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("llamadas") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } $qr = mysql_query("select * from datos"); $nrows = mysql_num_rows($qr); $rString = "n=".$nrows; for ($i=0; $i < $nrows; $i++) { $row = mysql_fetch_array($qr); $rstring .= "&Id".$i."=".$row['id']; $rString .= "&Dia".$i."=".$row['dia']."&Mes".$i."=".$row['mes']."&Ano".$i."=".$row['ano']; $rString .= "&Hora".$i."=".$row['hora']."&Minutos".$i."=".$row['minutos']; $rString .= "&Receptor".$i."=".$row['receptor']. $rString .= "&Destinatario".$i."=".$row['destinatario']. $rString .= "&Apellido".$i."=".$row['apellido']. $rstring .= "&Nombre".$i."=".$row['nombre']; $rstring .= "&Telefono".$i."=".$row['telefono']; $rstring .= "&Asunto".$i."=".$row['asunto']; } echo $rString; mysql_free_result($qr); ?> Thanks. Juan ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL query result with some errors!
Hi, Im trying to get a query result from mysql database to show it on a flash animation, so far i have this code that its supposed to connect to mysql server , make the query and get the results, store them on variables so that flash can read them. Basically i have these main fileds like : lastname, firstname and so on... a guy here told me correctly that i should in case to have more than one entry on the database, use the output like lastname1, lastname2, etc. I gues this code is doing that, but when i want to show that info on flash i get eg: lastname: smithn=0 lastname: jacksonn=1 when it should be lastname: smith lastname: jackson ... ... So i guess im doing something wrong, can someone point me in the right direcction?? Here is the php code: No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("llamadas") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } $qr = mysql_query("select * from datos"); $nrows = mysql_num_rows($qr); $rString = "n=".$nrows; for ($i=0; $i < $nrows; $i++) { $row = mysql_fetch_array($qr); $rstring .= "&Id".$i."=".$row['id']; $rString .= "&Dia".$i."=".$row['dia']."&Mes".$i."=".$row['mes']."&Ano".$i."=".$row['ano']; $rString .= "&Hora".$i."=".$row['hora']."&Minutos".$i."=".$row['minutos']; $rString .= "&Receptor".$i."=".$row['receptor']. $rString .= "&Destinatario".$i."=".$row['destinatario']. $rString .= "&Apellido".$i."=".$row['apellido']. $rstring .= "&Nombre".$i."=".$row['nombre']; $rstring .= "&Telefono".$i."=".$row['telefono']; $rstring .= "&Asunto".$i."=".$row['asunto']; } echo $rString; mysql_free_result($qr); ?> Thanks. Juan ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP-DB] connection to mysql db
make sure that: - your firewall is open on the port you're using, on both machines. - your user is set up to allow connections from other machines I wouldn't use root, regardless of it being at home or anywhere else. Why don't you set up a new user, allow it to be used from anywhere, and give it the permissions you need it to have? If that doesn't work, why don't you look up the connection error in google, or paste it here? The number of the error code usually leads to where the error comes from. Cheers, Matthias -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] connection to mysql db
You need to use the username and password of the database, not the OS, to connect to MySQL. You would also need to set up an account for the username/host name of the remote computer within MySQL for this to work successfully. If this is a new installation of MySQL, try leaving username and password blank as I think there is a default account with open credentials. In any event, have a look at the user table in the mysql database for the accounts that have been already set up. David |-+--> | | | | | | | |blackwater dev| | | <[EMAIL PROTECTED]>| | | | | | | | | | | | 10/11/2005 08:51 AM| | | | | | | | | | |-+--> >-| | | | | | | |To: | | php-db@lists.php.net | |cc: | | | | | | | | | | | |Subject: | | [PHP-DB] connection to mysql db | | | >-| I have mysql running on a linux box at my house. I want to connect to that box from another machine on my home network but get access errors. When connecting, I use the machines internal ip and the root name and password of the linux box but I get access denied errors. How can I connect? Thanks! -- 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] connection to mysql db
I have mysql running on a linux box at my house. I want to connect to that box from another machine on my home network but get access errors. When connecting, I use the machines internal ip and the root name and password of the linux box but I get access denied errors. How can I connect? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC Problem
Good morning, I have almost the same problem, but just with cirilic characters. I have this state on every page, html and php: if I try to show cirilic characters I don't have problems. If I try to insert names in cirilic then I have problems with some characters only. If I insert the names in latin characters I don't have anykind of problems. I have tried with phpMyAdmin interface. I can insert cirilic characters without problems, but if later I take this datas to my web site I obtain just . And if I read the cirilic characters I have introduced by the website there is no sense. I have tried changing the charset on both, database and website, without results. I have changed from POST to GET without fine result. Maybe an Apache problem? I am testing it right now. Lost, just lost. Kind regards, Serafin Matthias Willerich wrote: > this sounds a little bit like a wrong charset. I don't know which one your > database or your php is running on, but, for a start, play with this: > - charset of the file: If you open your file in an editor that allows > storing it as different kinds of charsets, try saving it as something > else. It's probably ANSI, try UTF-8 or Unicode. > - charset of delivery: If your request ends in one or the other form of > html, remember to put in a content type, like this: > > again, play around with the variable $charset, or, instead, hardcode it in > the way you need it. I'm not sure about this, but maybe you can change the > same thing by changing the character encoding in your browser manually and > not putting in any content-type. Once you've found what you need, put it > in as meta tag. > > Cheers, > Matthias > > > -Original Message- > From: Rodrigo Haces [mailto:[EMAIL PROTECTED] > Sent: 10 October 2005 23:13 > To: php-db@lists.php.net > Subject: [PHP-DB] ODBC Problem > > > Hi all: > > Im currently using php to connect to a database in another server, this > is a > intersystems cache database. > > if i do a query to my database and the result has special spanish > characters like "´" (á,é,í,ó,ú) it returns me another character, this one > changes from time to time, i just tried to make a test with the isql shell > program, i connect and ask for the same query and in shell it returns the > correct characters. > > If someone can help me please i'll apretiate. > > Thanks > rodrigo > > -- > 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] ODBC Problem
this sounds a little bit like a wrong charset. I don't know which one your database or your php is running on, but, for a start, play with this: - charset of the file: If you open your file in an editor that allows storing it as different kinds of charsets, try saving it as something else. It's probably ANSI, try UTF-8 or Unicode. - charset of delivery: If your request ends in one or the other form of html, remember to put in a content type, like this: again, play around with the variable $charset, or, instead, hardcode it in the way you need it. I'm not sure about this, but maybe you can change the same thing by changing the character encoding in your browser manually and not putting in any content-type. Once you've found what you need, put it in as meta tag. Cheers, Matthias -Original Message- From: Rodrigo Haces [mailto:[EMAIL PROTECTED] Sent: 10 October 2005 23:13 To: php-db@lists.php.net Subject: [PHP-DB] ODBC Problem Hi all: Im currently using php to connect to a database in another server, this is a intersystems cache database. if i do a query to my database and the result has special spanish characters like "´" (á,é,í,ó,ú) it returns me another character, this one changes from time to time, i just tried to make a test with the isql shell program, i connect and ask for the same query and in shell it returns the correct characters. If someone can help me please i'll apretiate. Thanks rodrigo -- 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