Re: PHP Question

2008-05-06 Thread Darryle steplight
Hi Michael,

Try placing the following at the top of your PHP code:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');

What error messages do you see on your page?


On Tue, May 6, 2008 at 12:07 PM, Jerry Schwartz <[EMAIL PROTECTED]>
wrote:

> In general, if I have a PHP-generated page that produces a blank page, I
> execute the PHP code from the command line. It will probably fall over
> dead
> somewhere along the line, but you'll know if there are any syntax errors.
>
> Regards,
>
> Jerry Schwartz
> The Infoshop by Global Information Incorporated
> 195 Farmington Ave.
> Farmington, CT 06032
>
> 860.674.8796 / FAX: 860.674.8341
>
> www.the-infoshop.com
> www.giiexpress.com
> www.etudes-marche.com
>
> >-Original Message-
> >From: Michael Condon [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, May 06, 2008 10:39 AM
> >To: mysql@lists.mysql.com
> >Subject: PHP Question
> >
> >I have a PHP script that seems to be failing. I execute it using
> >window.location.href("http://www.vote.com/vote2.php";):
> >
> > >$link = mysql_connect('localhost', 'login', 'password');
> >if (!$link) {
> >die('Could not connect: ' . mysql_error());
> >}
> >$result = use election
> >if (!$result) {
> >die('Could not connect: ' . mysql_error());
> >}
> >$result = mysql_query("update election set Votes = Votes + 1 where
> >Name='TheGuy'");
> > if (!$result) {
> >$message  = 'Invalid update: ' . mysql_error() . "\n";
> >$message .= 'Whole query: ' . $result;
> >die($message);
> >
> >mysql_close($link);
> >?>
> >
> >
> >--
> >MySQL General Mailing List
> >For list archives: http://lists.mysql.com/mysql
> >To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> >infoshop.com
>
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>


RE: PHP Question

2008-05-06 Thread Jerry Schwartz
In general, if I have a PHP-generated page that produces a blank page, I
execute the PHP code from the command line. It will probably fall over dead
somewhere along the line, but you'll know if there are any syntax errors.

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com

>-Original Message-
>From: Michael Condon [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 06, 2008 10:39 AM
>To: mysql@lists.mysql.com
>Subject: PHP Question
>
>I have a PHP script that seems to be failing. I execute it using
>window.location.href("http://www.vote.com/vote2.php";):
>
>$link = mysql_connect('localhost', 'login', 'password');
>if (!$link) {
>die('Could not connect: ' . mysql_error());
>}
>$result = use election
>if (!$result) {
>die('Could not connect: ' . mysql_error());
>}
>$result = mysql_query("update election set Votes = Votes + 1 where
>Name='TheGuy'");
> if (!$result) {
>$message  = 'Invalid update: ' . mysql_error() . "\n";
>$message .= 'Whole query: ' . $result;
>die($message);
>
>mysql_close($link);
>?>
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>infoshop.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PHP Question

2008-05-06 Thread Stut

On 6 May 2008, at 15:39, Michael Condon wrote:

I have a PHP script that seems to be failing. I execute it using
window.location.href("http://www.vote.com/vote2.php";):

$result = mysql_query("update election set Votes = Votes + 1 where  
Name='TheGuy'");

if (!$result) {
  $message  = 'Invalid update: ' . mysql_error() . "\n";
  $message .= 'Whole query: ' . $result;
  die($message);

mysql_close($link);
?>


1) What are you trying to do with "use election"??

2) Missing } - opened for the last if.

-Stut

--
http://stut.net/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PHP Question

2008-05-06 Thread Salah Nait-Mouloud
Hi.
try this


or this



regards

On Tue, May 6, 2008 at 4:39 PM, Michael Condon <[EMAIL PROTECTED]>
wrote:

> I have a PHP script that seems to be failing. I execute it using
> window.location.href("http://www.vote.com/vote2.php";):
>
>  $link = mysql_connect('localhost', 'login', 'password');
> if (!$link) {
>   die('Could not connect: ' . mysql_error());
> }
> $result = use election
> if (!$result) {
>   die('Could not connect: ' . mysql_error());
> }
> $result = mysql_query("update election set Votes = Votes + 1 where
> Name='TheGuy'");
> if (!$result) {
>   $message  = 'Invalid update: ' . mysql_error() . "\n";
>   $message .= 'Whole query: ' . $result;
>   die($message);
>
> mysql_close($link);
> ?>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
Salah NAIT-M
Echovox 


Re: PHP Question

2002-04-11 Thread BD

At 09:13 AM 4/11/2002, you wrote:
>Ok so this really doesnt have anything to do with MySQL but I thought this
>might be a good placeto ask.
>Ok heres the problem. I am constructing a Message Board with MySQL and php
>(was usingASP) and I dont want the user to reload/repost data. For 
>example, say the
>user goes to post amessage, after they hit the post button it takes them 
>to a temp page
>saying that there post wassuccesful with a link to go view the post. The 
>problem arises if some one
>decides to hit thereload button. Because of the way I have the posting 
>page setup it will
>reload the page and postthe message again! doh!
>Anyways, has anyone come up against a similar problem and found a
>way around it?
>
>Thanks in advance.
>-Nick

Nick,
 PHP solution. I suppose you could create a session variable with 
the last topic posted ($last_topic_posted) that gets set in the temp page 
(confirmation page). The previous page (Post.php) would check to see if the 
session variable exists when the user presses the "Post" button. If it does 
it warns the user it was already posted.

 MySQL solution. You would have to uniquely identify each post from 
the user to define a unique index in MySQL. Perhaps use the session id and 
topic title to prevent  two such records from existing in the table.

Brent


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: PHP Question

2002-04-11 Thread Andreas Frøsting

Hi,

> Ok so this really doesnt have anything to do with MySQL but I 
> thought this
> might be a good placeto ask.

Why?
As you say, it's not in any way related to MySQL.

> reload the page and postthe message again! doh!
> Anyways, has anyone come up against a similar problem and found a
> way around it?

Take a look at the header() function and please make use of the
php-mailinglist next time.

:wq
//andreas
http://phpwizard.dk


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: PHP Question

2002-04-11 Thread Tyler Longren

Here's what I do:

Insert their post into the database at the very top of the page.  Then use
php's header() function to forward them to another page after the post has
been put into the database.  This way, they can reload all they like because
they'll no longer be on the page that puts the post into the db.

Tyler

- Original Message -
From: "Nick Stuart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 11, 2002 9:13 AM
Subject: PHP Question


> Ok so this really doesnt have anything to do with MySQL but I thought this
> might be a good placeto ask.
> Ok heres the problem. I am constructing a Message Board with MySQL and php
> (was usingASP) and I dont want the user to reload/repost data. For
example, say the
> user goes to post amessage, after they hit the post button it takes them
to a temp page
> saying that there post wassuccesful with a link to go view the post. The
problem arises if some one
> decides to hit thereload button. Because of the way I have the posting
page setup it will
> reload the page and postthe message again! doh!
> Anyways, has anyone come up against a similar problem and found a
> way around it?
>
> Thanks in advance.
> -Nick
>
>
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php