Jump to content

[SOLVED] MYSQL help


dity

Recommended Posts

$tuonline=mysql_query("SELECT *,DATE_FORMAT(date,'%M %d at %l:%i %p')as 'lastonline' FROM mostonline");
$tuonline=mysql_fetch_array($tuonline);

 

If that is my code and im getting a

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...

 

Am I missing a table?

 

Thanks,

Link to comment
Share on other sites

New error after that code is

 

Unknown column 'date' in 'field list'

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/13/d195760324/htdocs/ladder/Forums/index.php on line 646

Link to comment
Share on other sites

I know how to create tables that have been predefined, for example

 

CREATE TABLE `ticketcontent` (
  `id` int(25) NOT NULL auto_increment,
  `ticketid` varchar(25) NOT NULL default '',
  `poster` varchar(25) NOT NULL default '',
  `postertype` char(1) NOT NULL default '',
  `content` text NOT NULL,
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
)

 

But I am not experienced enough to understand what you mean by look at the table definition.

 

If you mean that it says Unknown column 'date' in 'field list'

 

are you saying that date should go in a column field list?

 

Thanks in advance

Link to comment
Share on other sites

and would I be correct in assuming that this is the correct code in adding date to that column

 

ALTER TABLE mostonline ADD 'date' default null

 

Would that be the correct query to run?

 

Thanks in advance

Link to comment
Share on other sites

I'm installing this script and it appears they or I missed something...

 

Ignoring the fact that the script was written without any error checking, error reporting, or error recovery logic (which would earn it a C- in a programming class), you should not be having these type of problems or need to be modifying the tables if the tables have already been created.

 

Could you provide a link to the script's site so that someone can see what should be going on.

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.