Re: Probleme with MySQL queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> $sql = 'SELECT * FROM table WHERE id="'.$var.'" ';
> $req = mysql_query($sql) or die('Erreur SQL
> !<br>'.$sql.'<br>'.mysql_error());
> while($data = mysql_fetch_assoc($req)) {
>  echo $data['id'];
> }
> $sql2 = 'DELETE FROM table WHERE id="'.$var.'" ';
> $req2 = mysql_query($sql2) or die('Erreur SQL
> !<br>'.$sql2.'<br>'.mysql_error());

I'll ask the obvious: where and how is $var set, and did you echo your
$sql variable to try the query on your mysql server directly?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux