FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » part 2 - file exists not working
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: part 2 - file exists not working [message #182888 is a reply to message #182887] Tue, 24 September 2013 08:10 Go to previous messageGo to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
On Tue, 24 Sep 2013 17:19:28 +0930, David Robley wrote:

> richard wrote:
>
>> On Mon, 23 Sep 2013 22:07:29 -0400, Lew Pitcher wrote:
>>
>>> On Monday 23 September 2013 20:46, in comp.lang.php, me(at)home(dot)invalid
>>> wrote:
>>>
>>>> richard wrote:
>>>>
>>>> > I am attempting to show a play button when the file actually exists.
>>>> >
>>>> > This does pass the test the way it should, however, my test for display
>>>> > does not.
>>>> >
>>>> > How should I test to make sure a button shows when the file is there
>>>> > and show nothing when it isn't?
>>>> >
>>>> >
>>>> >
>>>> > $number=1;
>>>> >
>>>> > echo '<table border="1">';
>>>> > echo "<tr><th>Rank</th><th>Charted -
>>>> > Artist</th><th>Play</th><th>Flipside</th><th>Label</th><th>First
>>>> > Week</th><th>Peak</th><th>Weeks On Chart</th></tr>";
>>>> >
>>>> > while ($number<=100){
>>>> > $result = mysql_query("SELECT atitle,btitle,artist,label,avid,bvid FROM
>>>> > A$year WHERE id = $number");
>>>> <SNIP>
>>>>
>>>> Why on earth are you sending _100_ separate mysql queries when you could
>>>> do it with one query using BETWEEN ???
>>>
>>> Perhaps he wants his results in ascending sequence by id, and doesn't
>>> know about the ORDER BY clause.
>>>
>>> $result = mysql_query("SELECT atitle,btitle,artist,label,avid,bvid "
>>> "FROM A$year "
>>> "WHERE id BETWEEN 1 and 100 "
>>> "ORDER BY id ASC");
>>
>> Thanks for the clue.
>> As given, I got a parse error. Eliminated the extra quotes.
>> Output reseulted in one table row showing with no data.
>>
>> www.mroldies.met/filetest.php
>
> You do of course realise that you handle the returned result set by looping
> over it to get all the results? Please see
> http://www.php.net/manual/en/function.mysql-fetch-assoc.php which should
> give you a few tips on working with a result set of multiple records.
>
> You might have to rethink your code a little to get the correct display
> format.

interesting idea I will try it.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [urgent] need solution of Questions, in context of PHP5
Next Topic: Host recommendations (slightly OT)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 08:37:49 GMT 2024

Total time taken to generate the page: 0.06286 seconds