Jump to content

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
https://forums.phpfreaks.com/topic/117595-solved-mysql-help/
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
https://forums.phpfreaks.com/topic/117595-solved-mysql-help/#findComment-605598
Share on other sites

If it is, this should give sensible output

 

$tuonline=mysql_query("SELECT DATE_FORMAT(FROM_UNIXTIME(lastonline),'%M %d at %l:%i %p') as lastonline FROM mostonline");
$row=mysql_fetch_array($tuonline);
echo $row['lastonline'];

Link to comment
https://forums.phpfreaks.com/topic/117595-solved-mysql-help/#findComment-606006
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
https://forums.phpfreaks.com/topic/117595-solved-mysql-help/#findComment-606032
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.