Re: [PHP-DB] Fixing this code to show all variables!
Hello Juan If I declare &Telefono=4141414 in one line and in the next line I declare &Telefono=31453531, then I have overwritten the first variable. What you need to change is the name of the variable. You need to append your ID number to the variable name. So &Telefono01=4141414 and &Telefono02=31453531 will be two differently named variables. Luck Gabino -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Fixing this code to show all variables!
Thanks for the response, Now its fixed, and this is the output for the code: &Id=28&Apellido=sadfsadf&Nombre=asdfsdf&Dni=sadfsdf&Telefono=sadfsadf&Dia=1&Mes=12&Ano=2004&Hora=9&Minutos=50&Abogado=Dra. Claudia I. Gorno&Nombre=asdfsdf&Asunto=asdfsd&Donde=Guia Barrial Palermo&Id=26&Apellido=Sarasa&Nombre=Exequiel&Dni=23453425&Telefono=423452345&Dia=2&Mes=2&Ano=2005&Hora=12&Minutos=30&Abogado=Dra. Claudia I. Gorno&Nombre=Exequiel&Asunto=3452345&Donde=Guia Barrial Palermo&Id=27&Apellido=Zarlanga&Nombre=Washington&Dni=4234235&Telefono=1234234&Dia=10&Mes=2&Ano=2004&Hora=18&Minutos=15&Abogado=Dra. Claudia I. Gorno&Nombre=Washington&Asunto=sadfsdf&Donde=RadioDiez - Sensacion Termica But this is not showing the result as: &Id1=28&Apellido1=whatever. So im having the same problem i had before? the variables are been overwritten over and over again. What am i doing wrong? --- "Demigod at SD41.net" <[EMAIL PROTECTED]> escribió: > Here's your hint: > The variable you are passing to mysql_num_rows is > undefined. If what > you want is the number of rows returned by > mysql_query, then you need to > pass $result1 to mysql_num_rows instead. Also note > that you again use > the undefined $qr as the argument for > mysql_fetch_array two lines later. > ___ ¡Llevate a Yahoo! en tu Unifón! Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar. Encontrá más información en: http://ar.mobile.yahoo.com/sms.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Fixing this code to show all variables!
Ok, i´ve removed the "@" form them, and now im trying this, but its not working: // Request all data $result1 = mysql_query("select * from clientesnuevos"); $nrows = mysql_num_rows($qr); for ($i=0; $i < $nrows; $i++) { $row = mysql_fetch_array($qr); echo "&Id={$row['id']}"; echo "&Apellido={$row['apellidoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Dni={$row['dniclientesnuevos']}"; echo "&Telefono={$row['telefonoclientesnuevos']}"; echo "&Dia={$row['diacitaclientesnuevos']}"; echo "&Mes={$row['mescitaclientesnuevos']}"; echo "&Ano={$row['anocitaclientesnuevos']}"; echo "&Hora={$row['horacitaclientesnuevos']}"; echo "&Minutos={$row['minutoscitaclientesnuevos']}"; echo "&Abogado={$row['abogadoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Asunto={$row['asuntoclientesnuevos']}"; echo "&Donde={$row['dondeclientesnuevos']}"; } mysql_free_result($result1); ?> And this error es shown: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource Any hints?? --- Bastien Koert <[EMAIL PROTECTED]> escribió: > > remove the @ symbol from in front of the connect > functions > > @mysql_connect > @mysql_select_db > > Its supressing any errors that you may have...when > you finish the debugging, > then you can add them back in. > > bastien > > >From: Juan Stiller <[EMAIL PROTECTED]> > >To: [EMAIL PROTECTED] > >Subject: [PHP-DB] Fixing this code to show all > variables! > >Date: Mon, 1 Nov 2004 10:50:12 -0300 (ART) > > > >Hi, im trying to use this code to send a query to a > >mysql database, and then display the query results > and > >put the results on variables, the problem is that i > >don´t know how to make it so that if there is more > >than one result, it uses xvariables as results are, > >using this script just like it is, if its more than > >one result it overwrite the variable with the last > >result. Someone told me to use an array, but i dont > >have any idea how. > > > >Can you help me? > > > >THis is the script: > > >$conn = @mysql_connect("90.0.0.2", "javier", > >"315/95"); > > > >if (!$conn) { > >echo( "No se pudo conectar " . > >"al servidor MySQL." ); > >exit(); > >} > > > >if (! @mysql_select_db("clientes") ) { > >echo( "No se puede encontrar " . > >"la base de datos clientes!" ); > >exit(); > >} > > > >// Request all data > >$result1 = mysql_query("select * from > >clientesnuevos"); > > > >print "Results="; > >echo "Clientes agregados:"; > > > >while($row=mysql_fetch_array($result1, > MYSQL_ASSOC)) > >{ > >echo "&Id={$row['id']}"; > >echo "&Apellido={$row['apellidoclientesnuevos']}"; > >echo "&Nombre={$row['nombreclientesnuevos']}"; > >echo "&Dni={$row['dniclientesnuevos']}"; > >echo "&Telefono={$row['telefonoclientesnuevos']}"; > >echo "&Dia={$row['diacitaclientesnuevos']}"; > >echo "&Mes={$row['mescitaclientesnuevos']}"; > >echo "&Ano={$row['anocitaclientesnuevos']}"; > >echo "&Hora={$row['horacitaclientesnuevos']}"; > >echo > "&Minutos={$row['minutoscitaclientesnuevos']}"; > >echo "&Abogado={$row['abogadoclientesnuevos']}"; > >echo "&Nombre={$row['nombreclientesnuevos']}"; > >echo "&Asunto={$row['asuntoclientesnuevos']}"; > >echo "&Donde={$row['dondeclientesnuevos']}"; > >} > >mysql_free_result($result1); > >?> > > > >Thanks > >Juan > > > > > > > > > > > > > >___ > >¡Llevate a Yahoo! en tu Unifón! > >Ahora podés usar Yahoo! Messenger en tu Unifón, en > cualquier momento y > >lugar. > >Encontrá más información en: > http://ar.mobile.yahoo.com/sms.html > > > >-- > >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 > > ___ ¡Llevate a Yahoo! en tu Unifón! Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar. Encontrá más información en: http://ar.mobile.yahoo.com/sms.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Fixing this code to show all variables!
remove the @ symbol from in front of the connect functions @mysql_connect @mysql_select_db Its supressing any errors that you may have...when you finish the debugging, then you can add them back in. bastien From: Juan Stiller <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] Fixing this code to show all variables! Date: Mon, 1 Nov 2004 10:50:12 -0300 (ART) Hi, im trying to use this code to send a query to a mysql database, and then display the query results and put the results on variables, the problem is that i don´t know how to make it so that if there is more than one result, it uses xvariables as results are, using this script just like it is, if its more than one result it overwrite the variable with the last result. Someone told me to use an array, but i dont have any idea how. Can you help me? THis is the script: if (!$conn) { echo( "No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("clientes") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } // Request all data $result1 = mysql_query("select * from clientesnuevos"); print "Results="; echo "Clientes agregados:"; while($row=mysql_fetch_array($result1, MYSQL_ASSOC)) { echo "&Id={$row['id']}"; echo "&Apellido={$row['apellidoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Dni={$row['dniclientesnuevos']}"; echo "&Telefono={$row['telefonoclientesnuevos']}"; echo "&Dia={$row['diacitaclientesnuevos']}"; echo "&Mes={$row['mescitaclientesnuevos']}"; echo "&Ano={$row['anocitaclientesnuevos']}"; echo "&Hora={$row['horacitaclientesnuevos']}"; echo "&Minutos={$row['minutoscitaclientesnuevos']}"; echo "&Abogado={$row['abogadoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Asunto={$row['asuntoclientesnuevos']}"; echo "&Donde={$row['dondeclientesnuevos']}"; } mysql_free_result($result1); ?> Thanks Juan ___ ¡Llevate a Yahoo! en tu Unifón! Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar. Encontrá más información en: http://ar.mobile.yahoo.com/sms.html -- 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] Fixing this code to show all variables!
Hi, im trying to use this code to send a query to a mysql database, and then display the query results and put the results on variables, the problem is that i don´t know how to make it so that if there is more than one result, it uses xvariables as results are, using this script just like it is, if its more than one result it overwrite the variable with the last result. Someone told me to use an array, but i dont have any idea how. Can you help me? THis is the script: No se pudo conectar " . "al servidor MySQL." ); exit(); } if (! @mysql_select_db("clientes") ) { echo( "No se puede encontrar " . "la base de datos clientes!" ); exit(); } // Request all data $result1 = mysql_query("select * from clientesnuevos"); print "Results="; echo "Clientes agregados:"; while($row=mysql_fetch_array($result1, MYSQL_ASSOC)) { echo "&Id={$row['id']}"; echo "&Apellido={$row['apellidoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Dni={$row['dniclientesnuevos']}"; echo "&Telefono={$row['telefonoclientesnuevos']}"; echo "&Dia={$row['diacitaclientesnuevos']}"; echo "&Mes={$row['mescitaclientesnuevos']}"; echo "&Ano={$row['anocitaclientesnuevos']}"; echo "&Hora={$row['horacitaclientesnuevos']}"; echo "&Minutos={$row['minutoscitaclientesnuevos']}"; echo "&Abogado={$row['abogadoclientesnuevos']}"; echo "&Nombre={$row['nombreclientesnuevos']}"; echo "&Asunto={$row['asuntoclientesnuevos']}"; echo "&Donde={$row['dondeclientesnuevos']}"; } mysql_free_result($result1); ?> Thanks Juan ___ ¡Llevate a Yahoo! en tu Unifón! Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar. Encontrá más información en: http://ar.mobile.yahoo.com/sms.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php