MySQL Query Support Please xx

Status
Not open for further replies.

JoshuaLuke

Posting Freak
Jan 29, 2012
529
51
Hey,

Im wanting to clear the users inventory, but its linked in with the rooms items, so I figured out everything that is 0 in the room_id, in the items table, I need to delete.

What would be the mySQL query for this?

Thanks
Josh
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
I don't mean to be a dick man, but if this is for your CMS you're developing and you hardly know any PHP and/or MySQL, why are you tackling such a big project so soon?

Anyway, the code is:
PHP:
@mysql_query( "DELETE FROM `table` WHERE `room_id` = '0'" );

Or something... I'm not quite sure what you mean in your post. But from what I'm reading, that seems alright.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
From what I can understand ( Your English is shit ), you'd need to know the user's username or ID first of all.

Then you'd do. The 'inventory' table is just an example, replace with actual table.

Code:
DELETE FROM inventory WHERE user_id = '45'
 

JoshuaLuke

Posting Freak
Jan 29, 2012
529
51
I don't mean to be a dick man, but if this is for your CMS you're developing and you hardly know any PHP and/or MySQL, why are you tackling such a big project so soon?

Anyway, the code is:
PHP:
@mysql_query( "DELETE FROM `table` WHERE `room_id` = '0'" );

Or something... I'm not quite sure what you mean in your post. But from what I'm reading, that seems alright.

I dropped the CMS until I have an understanding of MySQL and PHP, realised I shouldn't jump into it straight away.

Anyway, thanks it worked (Y)

EDIT:
From what I can understand ( Your English is shit ), you'd need to know the user's username or ID first of all.

Then you'd do. The 'inventory' table is just an example, replace with actual table.

Code:
DELETE FROM inventory WHERE user_id = '45'

It's hard to understand, but Monsta got it correct
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
I dropped the CMS until I have an understanding of MySQL and PHP, realised I shouldn't jump into it straight away.

Anyway, thanks it worked (Y)
As I said, I wasn't meaning to be a dick. Just merely pointing out that a CMS is a huge project and with being a (no disrespect) newb to PHP, it wouldn't be a good idea to jump straight in to one.

Anyway, problem solved. Thread closed.

----------
It would be thread closed if this was in the coders paradise section!
 
Status
Not open for further replies.

Users who are viewing this thread

Top