Jump to content

delete mysql entry in a table


Captain09

Recommended Posts

here is my file:

 

mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."adventure");
DELETE FROM ".TB_PREFIX."adventure WHERE end="1"
mysql_select_db('adventure');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not delete data: ' . mysql_error());
}
mysql_close($conn);

 

and I get this error:

Parse error: syntax error, unexpected T_STRING in /var/customers/webs/Killer0709/deladventure.php on line 5

 

:shrug:

Link to comment
Share on other sites

:(

just tell me

 

I never worked with mysql

 

Why should we 'just tell you' -- this is site for people to exchange ideas -- not a site to demand answers.

 

If you really don't understand these comments, then this isn't your script.  Which means you shouldn't be changing it without understanding how it works.

Link to comment
Share on other sites

		
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
mysql_query("SELECT * FROM ".TB_PREFIX."adventure");
mysql_query("FROM ".TB_PREFIX."adventure WHERE end= 1");
mysql_close;

 

new error(s):

Warning: mysql_connect(): Access denied for user 'SQL_USER'@'176.9.37.48' (using password: YES) in /var/customers/webs/Killer0709/deladventure.php on line 2 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0002 645448 2. mysql_connect() /var/customers/webs/Killer0709/deladventure.php:2 Warning: mysql_select_db(): Access denied for user ''@'localhost' (using password: NO) in /var/customers/webs/Killer0709/deladventure.php on line 3 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0009 645272 2. mysql_select_db() /var/customers/webs/Killer0709/deladventure.php:3 Warning: mysql_select_db(): A link to the server could not be established in /var/customers/webs/Killer0709/deladventure.php on line 3 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0009 645272 2. mysql_select_db() /var/customers/webs/Killer0709/deladventure.php:3 Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /var/customers/webs/Killer0709/deladventure.php on line 4 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0011 645296 2. mysql_query() /var/customers/webs/Killer0709/deladventure.php:4 Warning: mysql_query(): A link to the server could not be established in /var/customers/webs/Killer0709/deladventure.php on line 4 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0011 645296 2. mysql_query() /var/customers/webs/Killer0709/deladventure.php:4 Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /var/customers/webs/Killer0709/deladventure.php on line 5 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0013 645296 2. mysql_query() /var/customers/webs/Killer0709/deladventure.php:5 Warning: mysql_query(): A link to the server could not be established in /var/customers/webs/Killer0709/deladventure.php on line 5 Call Stack: 0.0002 644936 1. {main}() /var/customers/webs/Killer0709/deladventure.php:0 0.0013 645296 2. mysql_query() /var/customers/webs/Killer0709/deladventure.php:5

 

I do not understand the world anymore...

Link to comment
Share on other sites

You know, the reason I gave you those links instead of "just telling you" was because you really do need to learn the basics. Everything you've posted so far has demonstrated a clear and desperate lack of knowledge about the basics, which you will need to correct in order to get this working.

 

You wouldn't just jump into a rally car to race it against professionals, if you didn't even know how to drive in the first place. Would you?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.