PDA

View Full Version : mysql query help


Rickie3
05-30-2005, 12:06 PM
i'm trying to execute a query for a hack,query as follows

alter table user add timespent int not null;

when i run the query this is the error i get

Error

SQL-query:

ALTER TABLE user ADD timespent int NOT NULL

MySQL said: Documentation
#1146 - Table 'satsfge_.user' doesn't exist

in the instructions for the hack it says
Run the following queries. You can do it via phpmyadmin, or at the
"Execute SQL Query" section at the Admin Control Panel
Remember to prefix the table if you need to.
any help appreciated

Marco van Herwaarden
05-30-2005, 12:22 PM
You seem to be using a table prefix, add that in front of 'user'.

Edit i only beat ZT because i gave the short answer. ;)

Zero Tolerance
05-30-2005, 12:22 PM
Change "user" to "{PREFIX}user", your table prefix is defined in includes/config.php

So if your prefix was 'vb3_', it would be:
ALTER TABLE vb3_user ADD timespent int NOT NULL :)

Edit: Marco beat me too it >.<

- Zero Tolerance

Colin F
05-30-2005, 01:52 PM
or, if you included global.php somewhere, use

$DB_site->query("ALTER TABLE " . TABLE_PREFIX . "user ADD timespent int NOT NULL");

Marco van Herwaarden
05-30-2005, 02:44 PM
or, if you included global.php somewhere, use

$DB_site->query("ALTER TABLE " . TABLE_PREFIX . "user ADD timespent int NOT NULL");I don't think this is in a script Colin. It is just installation instructions for a hack.

Colin F
05-30-2005, 05:00 PM
I don't think this is in a script Colin. It is just installation instructions for a hack.
Oh ok... disregard what I said :)

Rickie3
05-31-2005, 06:00 AM
thankyou so much guys for your support,it worked a treat,and the best part is ive learned in the process,thankyou.