php-general Digest 20 Dec 2010 12:37:49 -0000 Issue 7095
Topics (messages 310152 through 310156):
Re: HTML id attribute and arrays
310152 by: Martin C
Re: All records not displaying...
310153 by: Gary
Re: How does one reply to messages on this list?
310154 by: Gary
Re: Problem with Include
310155 by: Simcha Younger
Re: [PHP-DB] Re: [PHP] Problems w/ goto
310156 by: Daniel Brown
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
The "name" and "id" attributes do not have to be the same.
Thank you, I thought it should be the same
You're probably thinking of:
http://www.w3.org/TR/html401/struct/links.html#h-12.2.3
"The id and name attributes share the same name space. This means that
they cannot both define an anchor with the same name in the same
document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements: A, APPLET,
FORM, FRAME, IFRAME, IMG, and MAP. When both attributes are used on a
single element, their values must be identical."
Confusing, the "name" attribute on a form field ("input", "textarea",
"select", etc) is different to the "name" attribute on a "a" or "form"
element, so this rule does not apply to it.
Thank you, Benjamin, for clarification. This sounds like the source of
my (bogus) feeling.
Martin
--- End Message ---
--- Begin Message ---
"Tamara Temple" <[email protected]> wrote in message
news:[email protected]...
>
> On Dec 19, 2010, at 9:46 AM, Gary wrote:
>
>> I have an issue that the first record in a query is not being displayed.
>> It
>> seems that the first row in alphabetical order is not being brought to
>> the
>> screen.
>>
>> I have run the query in the DB and it displays the correct result, so it
>> has
>> to be in the php.
>>
>> I have a MySQL DB that lists beers. I have a column for 'type' of beer
>> (imported, domestic, craft, light). The queries:
>>
>> $result = MySQL_query("SELECT * FROM beer WHERE type = 'imported' AND
>> stock
>> = 'YES' ORDER by beername ");
>>
>> When I run the query
>>
>> if (mysql_num_rows($result) == !'0') {
>> $row = mysql_fetch_array($result);
>>
>> echo '<h3>Imported Beers</h3>';
>> echo '<table width="100%" border="0" cellspacing="1" cellpadding="1"
>> id="tableone" summary="">
>>
>> <th>Beer</th>
>> <th>Maker</th>
>> <th>Type</th>
>> <th>Singles</th>
>> <th>6-Packs</th>
>> <th>Cans</th>
>> <th>Bottles</th>
>> <th>Draft</th>
>> <th>Size</th>
>> <th>Description</th>';
>>
>> while ($row = mysql_fetch_array($result)) {
>>
>> echo '<tr ><td>' . $row['beername'].'</td>';
>> echo '<td>' . $row['manu'] . '</td>';
>> echo '<td>' . $row['type'] . '</td>';
>> echo '<td width="40">' . $row['singles'] . '</td>';
>> echo '<td width="20">' . $row['six'] . '</td>';
>> echo '<td width="40">' . $row['can'] . '</td>';
>> echo '<td width="20">' . $row['bottles'] . '</td>';
>> echo '<td width="40">' . $row['tap'] . '</td>';
>> echo '<td>' . $row['size'] . '</td>';
>> echo '<td>' . $row['descrip'] . '</td>';
>> '</tr>';
>> }
>> echo '</table><br />';
>>
>> }
>>
>> All but the first row in alphabetical order are displayed properly.
>>
>> Can anyone tell me where I am going wrong?
>> --
>> Gary
>>
>> BTW, I do have a bonus question that is about javascript in this same
>> file,
>> so if anyone want to take a stab at that, I'll be happy to post it.
>>
>
> This code will totally eliminate the first row of data.
>
>> if (mysql_num_rows($result) == !'0') {
>> $row = mysql_fetch_array($result);
>
> Fetches the first row, but is not output. Because:
>
>> while ($row = mysql_fetch_array($result)) {
>
> Fetches the second row before you do any output of the data.
>
> Eliminate the first fetch_array and you're code should work fine.
>
> BTW, if you put the <td> attributes 'width="n"' in the preceding <th>
> tags, you won't have to output them for each row. You should also put the
> units those numbers are associated with.
>
>
Tamara
Thank you for your help and thank you for the explaination. I removed the
line and it works fine. I dont remember where or why I had that line in
there, it is code that I have "recycled" for a while now.
Gary
__________ Information from ESET Smart Security, version of virus signature
database 5716 (20101219) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
David Harkness wrote:
> On Thu, Dec 16, 2010 at 8:09 AM, Daniel Molina Wegener
>> If your MUA (or email client) is smart enough, it should have at least
>>
>> "Reply", "Reply to Sender", "Reply to All" and "Reply to Mailing
> List".
>>
>
> To which my client adds "Reply to /dev/null", "Reply to Those Who
> Actually
> Care", and "Reply to Al Gore". It's much smarter than the average MUA.
I'm still waiting for one with a "Reply not to troll" option.
--- End Message ---
--- Begin Message ---
On Sun, 19 Dec 2010 17:41:20 +0000
"[email protected]" <[email protected]> wrote:
> Is your server even set up to recognise .inc files as php? You can't just put
> any old extension on and expect the server to know what to do with it.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
Since it is being included by PHP, and not served by Apache, the extension is
not important.
--
Simcha Younger <[email protected]>
--- End Message ---
--- Begin Message ---
On Sat, Dec 18, 2010 at 17:02, David Hutto <[email protected]> wrote:
> or maybe it's saturday morning and i'm drunk?
This seems to be the most likely, and considering how all messages
are permanently and independently archived and propagate throughout
the Internet, it might be a good reason not to go nuts in sending
unrelated and unintelligible messages of this nature in the future.
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/
--- End Message ---