p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

php_databases thread: Why when I select from a table the first result is missing???please-- Help


Message #1 by Info <info@d...> on Wed, 21 Mar 2001 22:46:57 -0600
I have done this many times i had never this problem before
I have a table with sixfields
cd_number, song_number, nameof_song, author, title,
record_id(autoincrement).

When I query from the server everything is fineWhen i query from a web page
everything is fine except if I make the query using the cd_number
the first song is always missing and the rest is fine

any ideas IAM GOING CRAZY WITH THIS

is so simple and i cant find whats going on??

select * from tablename where condition if the condition is cd_number the
first song of the cd is missing if is any other is fine

HELP HELP HOUSTON WE HAVE A PROBLEM

Jorge
----- Original Message -----
From: Jorge Cordero <jorge@d...>
To: professional php <pro_php@p...>
Sent: Miércoles, 21 de Marzo de 2001 04:36 p.m.
Subject: [pro_php] when querying a data base mysql_fecth_array jumps the 1st
record???


> I ha ve a database  with cd music albums
> author ,title, group, cd_number, and song_num also there is an auto
> increment id_num column.
> if i query the data base through my web page on the cd_number the first
song
> of  the cd never shows.
> but when query by any of the other fields everything is perfect.
> if i query directly on the server through telnet all of them are fine
> my query is so simple that cant see why this is happening
>
> $query=mysql_query("SELECT * FROM tablename WHERE cd_num=$cd_num order by
> song_num");
> this is the same query I am using for everything else the only change is
the
> WHERE clause.
>
> to extract the result I am using
>
> while($result=mysql_fetch_array($query)){
> results here (html table)
> }
> This have never happened before so if some out there knows whats going on
>
> Thanks for your help
>
> Jorge
>
> ----- Original Message -----
> From: Adam Lang <aalang@r...>
> To: professional php <pro_php@p...>
> Sent: Viernes, 16 de Marzo de 2001 08:39 a.m.
> Subject: [pro_php] Re: Variables PHP <=> JavaScript
>
>
> > You need to have a hidden input type that your PHP will increment each
> time
> > the page is recalled.  Then, have an if or case statement that checks
the
> > value of that hidden type to take appropriate action.
> >
> > Adam Lang
> > Systems Engineer
> > Rutgers Casualty Insurance Company
> > http://www.rutgersinsurance.com
> > ----- Original Message -----
> > From: "Thor Vadstein" <thor@l...>
> > To: "professional php" <pro_php@p...>
> > Sent: Thursday, March 15, 2001 10:21 PM
> > Subject: [pro_php] Re: Variables PHP <=> JavaScript
> >
> >
> > > > not directly no.  Remember that Javascript is on the client and PHP
is
> > > on
> > > > the server.  Thus Javascript can/will make either a POST or a GET to
> the
> > > > server passing variables the appropriate ways (querystring, etc..)
> from
> > > > there you can use them normally in your PHP code.
> > > >
> > >
> > > I will have to call the page again with the variables as part of the
> url,
> > > is that what you mean?
> > > Is there an easy way to separate between first and second (subsequent)
> > > calls to a page?
> > >
> > > Regards,
> > > ThorV.
>
>


  Return to Index