harristweed
-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Posts posted by harristweed
-
-
There is a strong possibility that 'like' is a reserved word in MYSQL try changing the field name.
-
-
http://tinymce.moxiecode.com/download.php
-
best I can do:
<?php $array=array( "one item", "two items", "two items", "three items", "three items", "three items", "end" ); $newarray=(array_count_values($array)); foreach ($newarray as $key => $value) { if($value<3)unset($newarray[$key]); } print_r ($newarray); // just reread your post $try_again=array(); foreach ($newarray as $key => $value) { for($i=0;$i<$value;$i++){ $try_again[]=$key; } } print_r ($try_again); ?>
-
Wont work, I'll think about MKII
-
<?php $array=array( "one item", "two items", "two items", "three items", "three items", "three items", "end" ); $newarray=(array_count_values($array)); foreach ($newarray as $key => $value) { if($value<3)unset($newarray[$key]); } print_r ($newarray); $flip=array_flip($newarray); print_r ($flip); ?>
-
make the button a link and not a button!
-
Sometimes the 'slanted apostrophe' will cause problems, try replacing with apostrophes from the keyboard
-
where is the function GetSQLValueString defined?
-
does
$_POST['navn'
contain any apostrophes?
-
this could help
-
i mean
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" accept-charset="utf-8">
Sorry, it's a bit early for me yet!
-
without seeing the errors...
change:
<form action="<?=$_SERVER['PHP_SELF']; ?>" method="post" accept-charset="utf-8">
to
<form action="<?php=$_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" accept-charset="utf-8">
and change the other short PHP tags to full tags "<?" to "<?php"
-
I have found that omitting the closing php tag on the include file sometimes cures this problem
-
Hi Cags
I know that it is not strictly required to pass an identifier but I have had problems with it in the past when not passing one and now always include it. Habit I guess. I think you could be right about the quotes.
-
I think you need to look at mysql for date if from database rather than php
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
-
change form to method = "get"
Change
foreach($_POST as $name => $value) { echo "$name = $value<br />\n"; }
to
foreach($_GET as $name => $value) { echo "$name = $value<br />\n"; }
If that displays the values the problem could well be with your host not posting correctly
-
Something like this?
date_default_timezone_set('America/Los_Angeles');// or where you are function date_diff($start, $end) { $sdate = strtotime($start); $edate = strtotime($end); $time = $edate - $sdate; if($time>=86400) { $days = ($edate - $sdate) / 86400; } return $days; } // example dates $sd="2010/3/2"; $ed="2010/3/9"; $diff= date_diff($sd, $ed); // this is the total days therefore total pages echo"days=$diff"; // create the pages as you would with normal pagination // get the date for the page/day // e.g. page 3 $page_number=3; $starting_day=strtotime($sd); $calculated_day = $starting_day+(60*60*24*$page_number); $date_for_this_day=date("Y-m-d",$calculated_day); // the mysql_query would be something like $result = mysql_query("SELECT * FROM meals WHERE menudate = '$date_for_this_day''");
-
try this:
foreach($_POST as $name => $value) { echo "$name = $value<br />\n"; }
in the receiving page and see what is displayed (with method = "post" )
-
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error());
should be
$link_id = mysql_connect("$dbhost","$dbuser","$dbpass")or die("Could not connect: ".mysql_error()); mysql_select_db("$dbname", $link_id) or die(mysql_error());
then:
$sql=“SELECT * FROM user WHERE username=’$username’ and password=’$password’ ”; $result=mysql_query($sql, $link_id);
-
I think the way you are attempting to solve this is wrong. Each page needs to display a menu for a specific day, therefore have a mysql query for each day that finds the menu for that specific day.
I don't know where you are getting the start day and end day from but it would not be difficult to count the days between these two dates and put the dates in to an array.
The number of days will equal the number of pages, so a page for each day with the relevant query.....
-
change:
$result1 = mysql_query("SELECT name, birthday FROM address WHERE MONTH(birthday) = MOD(MONTH(CURDATE()), 12)");
to:
$result1 = mysql_query("SELECT name, DATE_FORMAT(birthday, '%d-%m') as birthday FROM address WHERE MONTH(birthday) = MOD(MONTH(CURDATE()), 12)");
delete:
$sql = "SELECT *, DATE_FORMAT(birthday, '%d/%m/%Y')";
-
-
possibly something like:
php5 -f/home/sites/"your domain name"/public_html/_private/mining_reset.php
are there any help pages on your hosting?
Watermarking image upon upload!
in PHP Coding Help
Posted
This is a function I use for adding watermarks
As you see some parameters are held in variables that are set outside of the function
Hope this helps