Vivid Lust
-
Posts
456 -
Joined
-
Last visited
Posts posted by Vivid Lust
-
-
Error: 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 '' at line 3
Hi, i was wondering if someone could help me with this error please? I've been trying for 30 mins to get it sorted out but can't seem to, here is the code:
<?php ... $sql = "INSERT INTO `films` (`name`, `director`, `releaseDate`, `type`, `genre`, `translation`, `length`, `synopsis`, `image`, `downloadLink`, `megavideoLink`, `embeddLink` ) VALUES ('$name', '$director', '$releaseDate', '$type', '$genre', '$translation', '$legnth', '$synopsis', '$image', '$downloadLink', '$megavideoLink', '$embedLink'"; mysql_query($sql,$connection) or die(mysql_error()); ... ?>
-
the row has utf-bin, how do I change the encoding of the php? and the charset of the connection? thanks
-
Anyone?
-
Hi all,
This mysql query is finding no rows when used in a php file BUT does find a row when used in phpMyAdmin - this happens ONLY when there is a foreign character is in the phrase to be matched with a prhase that doesnt have a foreign character either , such as: á,ú,í,ó,é.
Here is the query:
SELECT * FROM films WHERE name=''Luna nueva, La saga Crepúsculo"
Could anyone please help? Find the row in phpmyadmin but not in php file?
Thanks.
This is the query
-
Hi,
I'm wanting to display how long ago in the format "x years, x months, x days ago", the date "12th June 2009" was, from the date today
How can I achieve this?
Thanks.
-
Any how to check if its from today?
-
One last question,
How would I check if "2009-10-30 13:20:35" is older than a week? Thanks.
-
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:
from today
from this week
from this month
from the last 3 months
from the last 6 months
from this year
from 1 year ago
etc etc
?
Thanks
-
I'm using the following code, but it isnt working - it doesnt echo "homepage" when it is on the root page, e.g : www.mysite.com/ :'(
<?php $addressFull = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; if( $addressFull == $_SERVER["SERVER_NAME"] ){ echo 'homepage'; }?>
Help anyone? Thanks
-
function round_it($value) {
return round($value*20) / 20;
}
Not sure why you couldn't make one yourself, it's hardly difficult
Because some of us are noobs. Will try it now, thanks.
-
echo '<img src="thumbs/nophoto.jpg" alt="'.$field1_name.'" />';
-
more or less a function.
-
To OP: Do you really want to round to the nearest 5/100ths? If so, your numbers are incorrect, 1.26 is closer to 1.25 than 1.30.
Perhaps you want to round up to the next 5/100ths? If that is the case, look to JAY6390's post.
(Edit: added "To OP" prefix)
My mistake! I meant to write 1.25 and not 1.30 , sorry guys
-
Thanks, how could i "wrap" some code around a single number to achieve this rather than having them in an array? Thanks.
-
how could i round to the nearest 5 or 10 with 2 decimal places? Here are some examples:
1.23 => 1.25
1.26 => 1.30
1.245 => 1.25
1.236 => 1.25
thanks!
-
Hi, the query is returning 0 rows
select DISTINCT `URL` from hits WHERE `cat`="language" AND DATE_FORMAT(`Time`, '%Y-%m-%d') > CURDATE() - INTERVAL 7 DAY
here is an example value of Time:
1256130486
Hope someone can help Thanks again!
-
any ideas? thanks.
-
Could anyone tell me how I could select records from the last 7 days which are stored in a MySQL database? I have a column named "time" using the php time() fuction. Could someone tell me the sql needed to do this?
thanks,
Jake.
-
Any comments please, guys?
-
UTF-8
-
Hi all,
I would like you to critic a website which i have recently turned from a french/english pen pal site, to a worldwide language penpal site. I'm not going to tell you much about it, as I don't want this to influence how you navigate, understand the content, etc.
If you are looking for a penpal, feel free to post a message, I would be very grateful as this would help you, the world and the site as a whole.
Here is the link: http://www.penpalamis.info/
Thank you all, I look forward to any criticisms
Jake.
-
Hi, this doesnt work... is there any php .. or even javascript function i can wrap around the data to display it properly?
-
I have an ajax script getting values from a database, the php script which gets the values displays the pound sign correctly, however the page which uses ajax to get this page displays it as the question mark. Any ideas on how i can resolve this? Thanks.
-
If I'm looping through numbers 1 to 50
check if a stored time() is more than 2 hours ago
in PHP Coding Help
Posted
I was wondering how I could check if a timestamp from time(), can be checked to see if it was made more thank 2 hours ago?
so
$timeInDatabase = 1259691739;
$timeTwoHoursAgo = foo;
if( $timeInDatabase <= $timeTwoHoursAgo ){
//do this
}
any help on filling this in?
thanks lots