Bonjour,
I have make this to have a button, it's an error, it's the first time I
have a problem with this.
I'm sorry to have get your time.
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route
an anchor around a submit button...?? I'm amazed that works!! :-)
A real link doesn't make a difference?
DELETE
[Make sure to replace 139 with an existing id...]
On Wed, Sep 3, 2008 at 9:50 PM, David DURIEUX <[EMAIL PROTECTED]> wrote:
> Bonjour,
>
> Humm if I go on page index.php?delete
Bonjour,
The problem come from the in the input submit
With text It works
It is very Space
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saô
Bonjour,
Humm if I go on page index.php?deleteid=139
it works
If I click on the link
I have the SELECT problem
I will be crazy
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (
> Your SELECT has a terminating semicolon.
I'm guessing Multiple statement execution is enabled by default...
http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bonjour,
It was difficult, I have many files in includes, I will try to execute
this code before in the php execution to see what code give problem.
I try this now and I tell you the results of investigations
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL
This is weird. Can you send over the complete file?
On Wed, Sep 3, 2008 at 8:56 PM, David DURIEUX <[EMAIL PROTECTED]> wrote:
> Bonjour,
>
> Yes DELETE is executed and I have on my page :
> string(3) "140"
> int(0)
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.34
> Port : 06.34.99.45.18
>
Can you turn on mysql query logging and see what is actually happening?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
David DURIEUX wrote:
> Bonjour,
>
> Yes I'm using this query and no row select
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.
Bonjour,
Yes DELETE is executed and I have on my page :
string(3) "140"
int(0)
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3
But the DELETE is executed? If it is, and it's in the condition, like
in the above code:
if ($row = mysql_fetch_assoc($query)) {
DELETE ...
}
something apparently is fetched
On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX <[EMAIL PROTECTED]> wrote:
> Bonjour,
>
> Yes I'm using this que
Bonjour,
PHP 5.2.6 on FreeBSD 7.0 i386 associate with apache 2.0.63
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 1
Bonjour,
Yes I'm using this query and no row select
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 20:43:25 +0200
> On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX <[EMAIL PROTECTED]> wrote:
>> Bonjour,
>>
>> I have always the problem, select = 0 rows and it delete it like if
>> delete is before the select :/
>>
>> Cordialement,
>>
>> David DURIEUX
Your SELECT has a terminating semicolon. Your DELETE does not.
Are you still using the code we talked about?
if ($row = mysql_fetch_assoc($query)) {
var_dump ($row);
mysql_query("DELETE FROM table WHERE id={$row['id']}") or
die("delete error: " . mysql_error());
}
if so, apparently it does fetch a row. Otherwise, can you send the
code y
Bonjour,
I have always the problem, select = 0 rows and it delete it like if
delete is before the select :/
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefra
On Wed, Sep 3, 2008 at 1:05 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote:
>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy <[EMAIL PROTECTED]> wrote:
>>> When using mysql_query, the SQL string to be executed should not end
>>> in
Bonjour,
No, I must test a little more, I tell in few minutes
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 20:05
On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy <[EMAIL PROTECTED]> wrote:
>> When using mysql_query, the SQL string to be executed should not end
>> in a semicolon.
>
> Ending a query with a semicolon should not be a problem - the
On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy <[EMAIL PROTECTED]> wrote:
> When using mysql_query, the SQL string to be executed should not end
> in a semicolon.
Ending a query with a semicolon should not be a problem - the string
is parsed by the mysql server, which handles it fine.
--
PHP Database M
When using mysql_query, the SQL string to be executed should not end
in a semicolon. Your initial post did not have a semicolon (but you
obviously edited it to make it generic). Perhaps this was the initial
problem? Subsequent posts had you terminating your queries with a
semicolon.
--
PHP Dat
Bonjour,
Yes record exist before the query and is deleted after
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 14:24:2
> Humm with this query I have forgotten to tell you the ID is DELETED
You mean the record with id=134?
> Are you sur it is 3 ? it is 134 no?
You're right :-)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bonjour,
Humm with this query I have forgotten to tell you the ID is DELETED
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Se
Bonjour,
Are you sur it is 3 ? it is 134 no?
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 14:17:59 +0200
"Evert Lamm
> string(3) "134" int(0)
This means you're trying to delete the entry with id=3, and that it
cannot find that in the database. Are you sure it exists? We tried the
queries separately and the SELECT had no problem... SELECT * FROM
table WHERE id=3;
--
PHP Database Mailing List (http://www.php.net
Bonjour,
I Have now :
string(3) "134" int(0)
Lunch... NOT, I haven't the time today :p but cheese and sausage is
good :)
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créac
> I have :
>
> array(2) { ["module"]=> string(12) "sousdomaines" ["deleteid"]=>
> string(3) "134" }
>
> But the ID is not deleted in mysql.
That seems to be your var_dump($_GET), which means that either if
(isset($_GET['deleteid'])) evaluates to FALSE or your SELECT does not
return results. Let's
Did you change $var=108; into
$var=mysql_real_escape_string($_GET['deleteid'])? :
if (isset($_GET['deleteid'])){
$var=mysql_real_escape_string($_GET['deleteid']);
$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
die("select error: " . mysql_error());
Bonjour,
array(2) { ["module"]=> string(12) "sousdomaines" ["deleteid"]=>
string(3) "133" }
Note : The ID is good deleted but no select return
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 ro
What does var_dump($_GET) say?
On Wed, Sep 3, 2008 at 12:48 PM, David DURIEUX <[EMAIL PROTECTED]> wrote:
> Bonjour,
>
> The query works
>
> But when I wrote this :
>
>
> if (isset($_GET['deleteid'])){
>
>$var=108;
>$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
>
Which means you do get results and your select works.
Now try:
$var=107;
$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
die(mysql_error());
if ($row = mysql_fetch_assoc($query))
var_dump ($data);
$query = mysql_query("DELETE FROM table WHERE id={$var}") or die(mysql_error());
Bonjour,
string(0) "" int(1)
string(0) "" int(1)
string(0) "" int(1)
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 03 Sep 2008
My bad, it should have the query handle as a parameter of course:
$var=107;
$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
die(mysql_error()); // make sure to use double quotes
var_dump(mysql_error(), mysql_num_rows($query));
$var=mysql_real_escape_string("107");
$query = mysql_q
You have to pass mysql_num_rows a $result variable from your query.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
David DURIEUX wrote:
> Bonjour,
>
>
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.34
> Port : 06.34.99.45.18
> Mail : [EMAIL PROTECTE
Bonjour,
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
ID is INT. It's ok before.
I have errors :
Warning: Wrong parameter count for
> In fact the first return 0 results
So the problem is in your select, and if your select works when you
manually insert the value for id (iow, without using $var), the
problem has something to do with $var.
Is the data type of the ID column INT? Try the following and let us
know the output:
$va
Bonjour,
No error for mysql_error for all 2 queries.
In fact the first return 0 results
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
L
> string(40) "SELECT * FROM table WHERE id=107 "
> string(3) "107"
And this query works when you run it on the database directly? Id 107 exists?
Assuming that that's both so we're running out of options.
After the select, can you do a print of mysql_error() and of mysql_num_rows()?
--
PHP Data
What does mysql_error return?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
David DURIEUX wrote:
> Bonjour,
>
>
> string(40) "SELECT * FROM table WHERE id=107 "
> string(3) "107"
> string(38) "DELETE FROM table WHERE id=107 "
> string(3) "107"
>
>
>
> Co
Bonjour,
string(40) "SELECT * FROM table WHERE id=107 "
string(3) "107"
string(38) "DELETE FROM table WHERE id=107 "
string(3) "107"
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de
>>If that doesn't work then var_dump($sql, $var) and write us the
>>result. Also let us know the data type of the ID column.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bonjour,
No changes :/
I have always the same things
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône
Le Wed, 3 Sep 2008 11:29:29 +0200
"E
Did you actually echo the $sql?
I know it works right now, but try to take away the quotes around the
value in the query and see if something happens:
$sql = "SELECT * FROM table WHERE id={$var}";
If that doesn't work then var_dump($sql, $var) and write us the
result. Also let us know the data t
Bonjour,
I have print and it's OK, the query is good like if I put the value
directly in the query
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur
At the begining $var is $_GET['id'] and after I try directly $var = 10
but no changes.
On the server directly, I can only try with the values :
$sql = 'SELECT * FROM table WHERE id="10" '; and for this no problem.
The problem is when I use a variable in query
Best regards,
David DURIEUX
Tel
Hi ,
For this situation , you should print out the SQL statement to check
the value of the variable "$var" .
--
From: "David DURIEUX" <[EMAIL PROTECTED]>
Sent: Wednesday, September 03, 2008 5:07 PM
To:
Subject: [PHP-DB] Probleme with MySQ
> $sql = 'SELECT * FROM table WHERE id="'.$var.'" ';
> $req = mysql_query($sql) or die('Erreur SQL
> !'.$sql.''.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
> !
47 matches
Mail list logo