Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9291
| From | "Peter H. Coffin" <hellsop@ninehells.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: isset not working with select |
| Date | 2013-05-13 07:43 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnkp1nvo.kvj.hellsop@nibelheim.ninehells.com> (permalink) |
| References | <zjgov1oukrit$.nu30chb74ox5.dlg@40tude.net> |
On Mon, 13 May 2013 07:01:46 -0400, richard wrote:
> http://mroldies.net/showtable.php?year=1960
>
>
>
> $result = mysql_query("SELECT acover,bcover FROM A$year WHERE id =
> $number");
> if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
> $cov = mysql_fetch_row($result);
>
>
> if (isset($cov[0]))
> {echo "<img src='http://mroldies.net/covers/$year/".$cov[0]."'>";}
> echo "<img src='http://mroldies.net/covers/$year/".$cov[1]."'>";
>
> On item #1 in the table, the panel appears with the desired images as
> wanted.
> On item #2 image place holders appear because I do not have them online
> yet.
> I do not want to see the place holders if there is not an image.
> What to use to do that?
If the first one works and the second one doesn't, maybe you should just
do them both like the first one?
> Also, if you click on 1961, or any other year, and then any item in the
> table, you will get a message below the videos stating the column does not
> exist so it can't continue processing.
> How can I bypass this when that database does not have that column?
Again, check for zero rows being returned in your program and build code
to handle that circumstance. die() is NOT your friend.
--
I wish there was a knob on the TV to turn up the intelligence. There's a
knob called "brightness", but it doesn't work.
-- Gallagher
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
isset not working with select richard <noreply@example.com> - 2013-05-13 07:01 -0400
Re: isset not working with select Scott Johnson <noonehome@chalupasworld.com> - 2013-05-13 05:49 -0700
Re: isset not working with select "Peter H. Coffin" <hellsop@ninehells.com> - 2013-05-13 07:43 -0500
Re: isset not working with select The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:31 +0100
Re: isset not working with select "J.O. Aho" <user@example.net> - 2013-05-13 20:10 +0200
Re: isset not working with select The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:43 +0100
Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-13 19:54 +0000
Re: isset not working with select richard <noreply@example.com> - 2013-05-14 17:38 -0400
Re: isset not working with select richard <noreply@example.com> - 2013-05-15 16:23 -0400
Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-15 20:34 +0000
Re: isset not working with select richard <noreply@example.com> - 2013-05-15 17:07 -0400
Re: isset not working with select Christoph Becker <cmbecker69@gmx.de> - 2013-05-15 23:18 +0200
Re: isset not working with select richard <noreply@example.com> - 2013-05-15 19:07 -0400
Syntax Highlighting (was: isset not working with select) Christoph Becker <cmbecker69@gmx.de> - 2013-05-16 01:33 +0200
Re: isset not working with select Tim Streater <timstreater@greenbee.net> - 2013-05-16 08:27 +0100
Re: isset not working with select richard <noreply@example.com> - 2013-05-15 17:12 -0400
Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-15 23:54 +0000
Re: isset not working with select Tim Streater <timstreater@greenbee.net> - 2013-05-15 22:15 +0100
csiph-web