GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Know anything about MySQL Queries through PHP ? (https://gfy.com/showthread.php?t=565799)

BlazingBucks_Ryan 01-19-2006 07:14 PM

Know anything about MySQL Queries through PHP ?
 
Ask me to do an install no problem... but I know absolutely NOTHING about programming, the last two days I have spent more time tweaking crap than I care to admit.. I think I am FINALLY starting to get the hand of basic database integration into websites through SQL Queries .. Anyways the code is below, my problem is it is displaying the date in this format 1137679440, 1137678780, 1137678240, and so on ..

I could change the way it appears in the mysql tables but then I risk it affecting the way the rest of the script displays the date. I assume there is some way to convert the date through php code into standard XX/XX/XXXX format.. Time and date would be nice if I could get it from that also.. Any ideas? Code is below,


Code:

<?
$query = "SELECT bhost_entries.e_id,bhost_entries.title,bhost_entries.date,bhost_weblogs.owner,bhost_weblogs.weblog FROM bhost_entries,bhost_weblogs WHERE bhost_entries.author_u_id = bhost_weblogs.u_id ORDER BY bhost_entries.e_id DESC LIMIT 12";
$result = mysql_query($query);
echo mysql_error();
while(list($id,$title,$date,$owner,$weblog) = mysql_fetch_array($result))
{
echo "<TR><TD WIDTH=100><a href='http://$weblog.domainname.com/profiles/directory/' target='new'>$owner:</a></TD><TD WIDTH=400><a href='http://$weblog.domainname.com/' target='new'>$title</a> $date</TD></TR>";
}
?>


Varius 01-19-2006 07:19 PM

In your query you can use the mysql function FROM_UNIXTIME() around the field in question...or on the PHP side, you can use the date() function on it to format it as you like :)

BlazingBucks_Ryan 01-19-2006 07:21 PM

Awesome :) Thanks Varius !!

BlazingBucks_Ryan 01-19-2006 07:43 PM

Worked perfectly, tried to use the mysql function but I didn't like the output .. quick google showed me how to do the formatting and boom! ;)

Thanks Again Bro !


All times are GMT -7. The time now is 01:36 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123