Date: 06/16/02
- Next message: César Aracena: "RE: [PHP-DB] Extracting Time??"
- Previous message: César Aracena: "[PHP-DB] Extracting Time??"
- In reply to: Denis Arh: "Re: [PHP-DB] Arraying JOINED tables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks a lot. It was an error... a HUGE one though :-)
César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621
> -----Mensaje original-----
> De: Denis Arh [mailto:denis <email protected>]
> Enviado el: Domingo, 16 de Junio de 2002 04:28 a.m.
> Para: php-db <email protected>
> Asunto: Re: [PHP-DB] Arraying JOINED tables
>
> Try find out if you have an error in your query, like this:
>
> $query = "SELECT * FROM logins,auth WHERE logins.authname = $variable1
> AND auth.authid = $variable2";
> if ( $result = <email protected>($query) ) {
> $row = mysql_fetch_array($result);
> }
> else {
> echo mysql_error();
> }
>
> and the other thing... maybe you have fields in both table logins and
auth
> with the same name
>
>
> Denis Arh
>
>
>
> ----- Original Message -----
> From: "César Aracena" <caracena <email protected>>
> To: "PHP DB List" <php-db <email protected>>
> Sent: Sunday, June 16, 2002 8:59 AM
> Subject: [PHP-DB] Arraying JOINED tables
>
>
> Hi all. Hope you're all alright since I don't see any of you writing
for
> some time now ;-)
>
> This should be an easy one for all of you. I want to make a basic
SELECT
> query from two tables and fetch all the results into one array. I'm
> doing it like this:
>
> $query = "SELECT * FROM logins,auth WHERE logins.authname = $variable1
> AND auth.authid = $variable2";
> $result = mysql_query($query);
> $row = mysql_fetch_array($result);
>
> and I get: Warning: Supplied argument is not a valid MySQL result
> resource in blah blah.
>
> What am I doing wrong? Thanks in advance,
>
> Cesar Aracena <mailto:webmaster <email protected>>
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>
>
>
>
>
> --
> 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
- Next message: César Aracena: "RE: [PHP-DB] Extracting Time??"
- Previous message: César Aracena: "[PHP-DB] Extracting Time??"
- In reply to: Denis Arh: "Re: [PHP-DB] Arraying JOINED tables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

