hmmm i dont know what you are saying me xP
im noob with this things, but the "FROM" select tha table "club"
And the bd.php included select the database that is clubd
I try too with DELETE FROM clubd.club WHERE contra=.... but dont works too
hmmm i dont know what you are saying me xP
im noob with this things, but the "FROM" select tha table "club"
And the bd.php included select the database that is clubd
I try too with DELETE FROM clubd.club WHERE contra=.... but dont works too
camaron wrote:And the bd.php included select the database that is clubd
No, it doesn't. The file db.php never uses [man]mysql_select_db/man, so db.php never selects the database.
camaron wrote:hmmm i dont know what you are saying me xP
I'm saying quite simply: use [man]mysql_select_db/man to select the database before you perform any queries.
Perhaps its the language barrier that's causing problems? If so... ojalá que puedes entenderme si yo hablo en español:
Necesitas usar la función [man]mysql_select_db/man antes de [man]mysql_query/man para seleccionar la base de datos. Por ejemplo, puedes usarla en "db.php" después de [man]mysql_connect/man o [man]mysql_pconnect/man.
My apologies if my Spanish is hard to understand. :o
xD hablas espaΓ±ol rofl, haber, tonces que pongo algo asi
<?php
include ("db.php");
mysql_select_db(club)
mysql_query("DELETE FROM * WHERE CONTRA=". $_REQUEST["contra"] .";" ,$db);
if (mysql_errno()!=0)
{
echo "Error al dessuscribirse, comuniquese con nosotros : ". mysql_errno() . " - " . mysql_error();
mysql_close($db);
} else {
header("location:index.html");
}
?>
pero sigue sin funcar, me tira esto
Parse error: syntax error, unexpected T_STRING in /www/****/htdocs/delete.php on line 4
I used Spanish just in case you weren't understanding my English correctly. I (and the majority of the boad, more than likely) would prefer that you use English if at all possible. I can speak some Spanish... not enough to help you learn a computer programming language, more than likely. :o
Your problem is that you forgot an ending semicolon after the [man]mysql_select_db/man call that you added. In addition, strings in PHP (for example, the name of the db "club") must be enclosed in quotes.
i add the quotes
mysql_select_db("club")
but steel dont working :S
can i add you on msn?
camaron;10951102 wrote:i add the quotes
mysql_select_db("club")but steel dont working :S
Check if the function returns FALSE and, if so, output [man]mysql_error/man to see what the error message is.
Also, are you sure "club" is the correct database name? In your db.file, you have this:
$database_db = "clubd";
suggesting that "club" should actually be "clubdb" instead.
camaron;10951102 wrote:can i add you on msn?
You can, but I hardly ever use MSN and I would much rather we keep the discussion here on the forums (so that others may participate and/or benefit if they come across this thread while searching).
Also, are you sure "club" is the correct database name? In your db.file, you have this:
yeah
i have to go to sleep :S its late here
anyway, thanks for all the help
can we continue with this tomorrow?
camaron wrote:can we continue with this tomorrow?
Sí - claro. Hasta mañana...!
mysql_query("DELETE FROM club WHERE CONTRA=". $_REQUEST["contra"] .";" ,$db);
Since this contra is a string, it will need to be quoted in the SQL statement.
mysql_query("DELETE FROM club WHERE CONTRA='". $_REQUEST["contra"] ."'" ,$db);
THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSS....
Final code:
<?php
include ("db.php");
mysql_select_db("club");
mysql_query("DELETE FROM club WHERE CONTRA='". $_REQUEST["contra"] ."'" ,$db);
if (mysql_errno()!=0)
{
echo " No se ah podido borrar: ". mysql_errno() . " - " . mysql_error();
mysql_close($db);
} else {
header("location:index.html");
}
?>
I use the select_db (thanks brad)
And the ' (thanks weed)
HEROES bradgrafelman AND Weedpacket
Hey, I'm no hero (although I can definitely picture Weedpacket in a cape). :p
Glad you figured it out. Don't forget to mark this thread resolved using the link on the Thread Tools menu above.
Nononono...definitely no cape. No capes!