List:General Discussion« Previous MessageNext Message »
From:Stut Date:May 6 2008 5:48pm
Subject:Re: PHP Question
View as plain text  
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"):
>
> <?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);
> ?>

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

2) Missing } - opened for the last if.

-Stut

-- 
http://stut.net/
Thread
MySQL (mysql-5.0.54)Kaushal Shriyan6 May 2008
  • Re: MySQL (mysql-5.0.54)Juan Eduardo Moreno6 May 2008
  • PHP QuestionMichael Condon6 May 2008
    • Re: PHP QuestionSalah Nait-Mouloud6 May 2008
    • Re: PHP QuestionStut6 May 2008
    • RE: PHP QuestionJerry Schwartz6 May 2008
      • Re: PHP QuestionDarryle steplight6 May 2008
  • Security Web SiteMichael Condon6 May 2008