Re: mysql query error.
| From: | Thomas Goeminne | Date: | Sun, 15 Sep 2002 21:04:20 +0000 |
| Subject: | Re: mysql query error. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116466@lists.php.net to get a copy of this message | ||
I got another problem with the submit scrript off the agenda
<?php
// Party module for PHP-NUKE 5.6
// Written by Thomas Goeminne, webmaster@hiphopstore.be
// Copyright (c) 2002, Thomas Goeminne
// Released under the GNU General Public License,
// www.gnu.org
// Set this to 0 if you want the right hand blocks to appear on-screen
// while this module is showing
$index = 0;
include("header.php");
OpenTable();
if(!IsSet($stage))
{
?>
<form method="post" action="<? print("$PHP_SELF"); ?>">
<table width="500" border="0">
<tr>
<td width="82">Title</td>
<td width="408">
<input type="text" name="title">
</td>
</tr>
<tr>
<td width="82">Event</td>
<td width="408">
<textarea name="event"></textarea>
</td>
</tr>
<tr>
<td width="82">date</td>
<td width="408">
<input type="text" name="date">
</td>
</tr>
<tr>
<td width="82">Startime</td>
<td width="408">
<input type="text" name="start">
</td>
</tr>
<tr>
<td width="82">Location</td>
<td width="408">
<input type="text" name="location">
</td>
</tr>
<tr>
<td width="82">Entrance</td>
<td width="408">
<input type="text" name="entrance" value="0.00">
euro </td>
</tr>
<tr>
<td width="82">homepage</td>
<td width="408">
<input type="text" name="homepage" value="http://">
</td>
</tr>
<tr>
<td width="82">sitename</td>
<td width="408">
<input type="text" name="site">
</td>
</tr>
<tr>
<td width="82">email</td>
<td width="408">
<input type="text" name="email">
</td>
</tr>
<tr>
<td width="82">Free Tickets</td>
<td width="408">
<input type="text" name="tickets">
(number from 1 till ...)</td>
</tr>
</table>
<br>
<INPUT TYPE=HIDDEN NAME="stage" VALUE=1>
<INPUT TYPE=SUBMIT>
</form>
<?
}
else
{
$enter = "INSERT INTO nuke_party (title, event, date, start, location,
entrance, homepage, site, email, tickets) VALUES ('$title', '$event',
'$date', '$start', '$location', '$entrance',
'$homepage', '$site', '$email',
'$tickets');
$tester = mysql_query($enter);
if($tester == 0)
echo "There has been a problem";
else
echo "Your information has been recorded";
}
CloseTable();
include("footer.php");
?>
I get an error on line 96 which is: echo "There has been a problem";
I don't know why this goes wrong
"John Holmes" <holmes072000@charter.net> schreef in bericht
news:000701c25ce8$69e33060$b402a8c0@mango...
> You are missing a closing brace. The syntax of a while is:
>
> While( [condition] )
> {
> [do something]
> }
>
> You are missing the closing brace, the }, that tells the while loop
> where to end.
>
> It depends on your code where you put it. What do you want executed
> within the while() loop?
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Thomas Goeminne [mailto:dabomb_gent@hotmail.com]
> > Sent: Sunday, September 15, 2002 2:33 PM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] mysql query error.
> >
> > And how do I close it then? I tried some things but it doesnt work.
> > "John Holmes" <holmes072000@charter.net> schreef in bericht
> > news:000501c25ce5$be1a5c60$b402a8c0@mango...
> > > An error on the last line of your file almost always means you are
> > > missing a closing brace. You are not closing your while() loop.
> > >
> > > ---John Holmes...
> > >
> > > > -----Original Message-----
> > > > From: Thomas Goeminne [mailto:dabomb_gent@hotmail.com]
> > > > Sent: Sunday, September 15, 2002 2:08 PM
> > > > To: php-general@lists.php.net
> > > > Subject: [PHP] mysql query error.
> > > >
> > > > <?php
> > > >
> > > > // Party module for PHP-NUKE 5.6
> > > > // Written by Thomas Goeminne, webmaster@hiphopstore.be
> > > > // Copyright (c) 2002, Thomas Goeminne
> > > > // Released under the GNU General Public License,
> > > > // www.gnu.org
> > > >
> > > >
> > > > // Set this to 0 if you want the right hand blocks to appear
> on-screen
> > > > // while this module is showing
> > > >
> > > > $index = 0;
> > > >
> > > > include("header.php");
> > > >
> > > > OpenTable();
> > > >
> > > > echo "<b><u>Party Agenda<u></b>";
> > > > echo "<BR>";
> > > >
> > > > $query = "SELECT * FROM nuke_party ORDER BY date, title";
> > > > $result_id = mysql_query($query);
> > > > ?>
> > > > <table>
> > > >
> > > > <?
> > > > while ($a=mysql_fetch_object($result_id)){
> > > > ?>
> > > > <table>
> > > > <tr><td>date</td>
> > > > <td> <? print "$a =>date"
> > > > ?></td></tr>
> > > > <tr><td>title</td>
> > > > <td> <? print "$a =>title"
> > > > ?></td></tr>
> > > > <tr><td>event</td>
> > > > <td> <? print "$a =>event"
> > > > ?></td></tr>
> > > > <tr><td>start</td>
> > > > <td> <? print "$a =>start"
> > > > ?></td></tr>
> > > > <tr><td>location</td>
> > > > <td> <? print "$a =>location"
> > > > ?></td></tr>
> > > > <tr><td>entrance</td>
> > > > <td> <? print "$a =>entrance"
> > > > ?></td></tr>
> > > > <tr><td>homepage</td>
> > > > <td> <a href="<? print "$a
> > > > =>homepage" ?>"
> > > > target="_blank"><? print "$a => site"
> > > > ?></a></td></tr>
> > > >
> > > > </table>
> > > >
> > > > <?
> > > > CloseTable();
> > > >
> > > > include("footer.php");
> > > > ?>
> > > >
> > > >
> > > > I get an error message that there is an erro on the last line off
> > > code.
> > > > Any
> > > > helpfull tips?
> > > >
> > > > Basicly what i want is to display the party information in a
> table.
> > > > --
> > > > Thomas Goeminne
> > > > Executive NV
> > > > Kortrijksepoortstraat 7
> > > > 9000 Gent Belgium
> > > > Tel/fax: + 32 9 223 0393
> > > > BTW: BE 455.676.207
> > > > URL: http://clik.to/bomb
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit:
> > > > http://www.php.net/unsub.php
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>