Warning Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Spookytheda
Forum Newbie
Posts: 3
Joined: Sat Feb 28, 2009 11:42 pm

Warning Error

Post by Spookytheda »

Hey! My knowledge of php is absolute minimal. I managed to get my site together but am receiving an error that reads...
Warning: date() expects parameter 2 to be long, string given in /home/sigmadiv/subdomain_html/sdhq/admin/admin_colist.php on line 50
The coding I do have says:
<td>Name: <?php echo $cos[5]; ?><br />Last report: <?php echo $cos[7]; ?><br />Application Date: <?php echo date("F j, Y, g:i a",$cos["appdate"]); ?></td>
Any help, advice, suggestions you can give me is greatly appreciated!
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Warning Error

Post by php_east »

<td>Name: <?php echo $cos[5]; ?><br />Last report: <?php echo $cos[7]; ?><br />Application Date: <?php echo date("F j, Y, g:i a",$cos["appdate"]); ?></td>

Any help, advice, suggestions you can give me is greatly appreciated!
don't know the nature of value $cos["appdate"] is, but try and see if
strtotime($cos["appdate"]) gives meaningful results.

like so...
<?php echo date("F j, Y, g:i a",strtotime($cos["appdate"])); ?>
Spookytheda
Forum Newbie
Posts: 3
Joined: Sat Feb 28, 2009 11:42 pm

Re: Warning Error

Post by Spookytheda »

Your a champion! It's fixed :)
Spookytheda
Forum Newbie
Posts: 3
Joined: Sat Feb 28, 2009 11:42 pm

Re: Warning Error

Post by Spookytheda »

Now this is going to sound really stupid but anyone able to explain this error for me?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5, 1)' at line 1
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Warning Error

Post by php_east »

here is the same error translated into english...

" you were trying to send some instructions to mysql, but your instructions were unclear.
you have not spoken the mysql langauge correctly, and mysql was not able to understand what you meant at line (1) near the text '5,1'. therefore, mysql has no choice but to stop receiving the instructions and send u a message which says...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5, 1)' at line 1


hope this helps.
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Warning Error

Post by php_east »

Spookytheda wrote:Your a champion! It's fixed :)
if one bug fix makes a champion, we would have an overpopulation of champions on earth here, right now. :crazy: but thanks anyway for the compliments.
Post Reply