Jump to content

bluemicrobyte

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bluemicrobyte's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, poirot, that works nicely.
  2. The following code: [code]     $imagefilearray = array();     while ($row = mysql_fetch_row($result)) {         $imagefilearray = array_push($imagefilearray, $row[2]);     }     $newimage = array_rand($imagefilearray); [/code] Gives me: Warning: array_rand(): First argument has to be an array What I'm trying to do is put all the $row[2]s in an array then select a random item from that array.
  3. So I need to do the following things to my MySQL table but its giving me errors about it not being formatted correctly. Please help!! "CREATE TABLE " . LOGS_TABLE . " ( id_log MEDIUMINT(10) NOT NULL DEFAULT '0' AUTO_INCREMENT, mode VARCHAR(50) NULL DEFAULT '', topic_id MEDIUMINT(10) NULL DEFAULT '0', user_id MEDIUMINT(8) NULL DEFAULT '0', username VARCHAR(255) NULL DEFAULT '', user_ip CHAR(8) DEFAULT '0' NOT NULL, time INT(11) NULL DEFAULT '0', PRIMARY KEY (id_log))"; ------------------------------------------------- "CREATE TABLE " . LOGS_CONFIG_TABLE . " ( config_name varchar(255) NOT NULL, config_value varchar(255) NOT NULL, PRIMARY KEY (config_name))"; ------------------------------------------------ "INSERT INTO " . LOGS_CONFIG_TABLE . " ( config_name, config_value) VALUES ('all_admin', 0)"; ---------------------------------------------- "ALTER TABLE " . USERS_TABLE . " ADD user_view_log TINYINT NOT NULL DEFAULT '0'"; break; case 'postgresql': -------------------------------------- "CREATE TABLE " . LOGS_TABLE . " ( id_log SERIAL NOT NULL PRIMARY KEY, mode VARCHAR(50) DEFAULT '', topic_id INT4 DEFAULT 0, user_id INT4 DEFAULT 0, username VARCHAR(255) DEFAULT '', user_ip CHAR(8) DEFAULT '0' NOT NULL, time INT4 DEFAULT 0 )"; ---------------------------------------------- "CREATE TABLE " . LOGS_CONFIG_TABLE . " ( config_name varchar(255) NOT NULL PRIMARY KEY, config_value varchar(255) NOT NULL )"; ------------------------------------------------- "INSERT INTO " . LOGS_CONFIG_TABLE . " ( config_name, config_value ) VALUES ( 'all_admin', 0 )"; --------------------------------------- "ALTER TABLE " . USERS_TABLE . " ADD user_view_log INT2 NOT NULL DEFAULT 0";
×
×
  • 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.