
gaza165
Members-
Posts
472 -
Joined
-
Last visited
Never
Everything posted by gaza165
-
how do i echo out the email.... is the with the BODY() function...how do i filter the array of data??
-
do i need to include php_imap.dll???
-
How easy is it to create a file in php which retrieves email using POP3??
-
still not 100% clear on what you are trying to do...explain more please
-
<?php function smoothdate ($year, $month, $day) { return sprintf ('%04d', $year) . sprintf ('%02d', $month) . sprintf ('%02d', $day); } function date_difference ($first, $second) { $month_lengths = array (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $retval = FALSE; if ( checkdate($first['month'], $first['day'], $first['year']) && checkdate($second['month'], $second['day'], $second['year']) ) { $start = smoothdate ($first['year'], $first['month'], $first['day']); $target = smoothdate ($second['year'], $second['month'], $second['day']); if ($start <= $target) { $add_year = 0; while (smoothdate ($first['year']+ 1, $first['month'], $first['day']) <= $target) { $add_year++; $first['year']++; } $add_month = 0; while (smoothdate ($first['year'], $first['month'] + 1, $first['day']) <= $target) { $add_month++; $first['month']++; if ($first['month'] > 12) { $first['year']++; $first['month'] = 1; } } $add_day = 0; while (smoothdate ($first['year'], $first['month'], $first['day'] + 1) <= $target) { if (($first['year'] % 100 == 0) && ($first['year'] % 400 == 0)) { $month_lengths[1] = 29; } else { if ($first['year'] % 4 == 0) { $month_lengths[1] = 29; } } $add_day++; $first['day']++; if ($first['day'] > $month_lengths[$first['month'] - 1]) { $first['month']++; $first['day'] = 1; if ($first['month'] > 12) { $first['month'] = 1; } } } $retval = array ('days' => $add_day); } } return $retval; } $begin = array ('year' => 2008, 'month' => 1, 'day' => 19); //START DATE HERE $end = array ('year' => date("Y"), 'month' => date("m"), 'day' => date("d")); //END DATE HERE $foo = date_difference ($begin, $end); foreach ($foo as $key => $value) { echo "<p>".$value." ".$key." have passed</p>"; } ?> here is a function i found on the web so i cant take credit for it...hope it helps
-
Hello can someone tell me how i can transfer the first 20 records from a table into another table in my database the two tables are chat and chat_backup???
-
I have now added rooms to my shoutbox and tried to improve its responsiveness I have also added BBCodes to be used. http://myshoutbox.thedesignmonkeys.co.uk
-
I just really want to know about this is it taking [ as part of it?
-
I am trying to look for these words in a record in my table [url [img [b something like that but this doesnt work Code: [select] $message = mysql_query("SELECT * FROM chat WHERE message IN ('[url','[b','[img') AND chat_id = $lastid ");
-
I am trying to look for these words in a record in my table [url [img [b something like that but this doesnt work $message = mysql_query("SELECT * FROM chat WHERE message IN ('[url','[b','[img') AND chat_id = $lastid ");
-
can u tell me more please???
-
Have just added bbcodes... check it out... dont post rubbish or offensive images please....
-
Is there anyway i can search through my database through an array of items?? <?php $array = array('url','img','b'); $message = mysql_query("SELECT * FROM chat WHERE chat_id = $lastid AND message LIKE '%$array%'"); ?>
-
I am trying to install BBCodes but i get this error Warning: require_once(HTML/BBCodeParser.php) [function.require-once]: failed to open stream: No such file or directory in /home/thedesig/public_html/myshoutbox/action/getmessages.php on line 11 Fatal error: require_once() [function.require]: Failed opening required 'HTML/BBCodeParser.php' (include_path='php/:') in /home/thedesig/public_html/myshoutbox/action/getmessages.php on line 11 this is the screenshot of the structure of my server... im trying to sort my include_path to be able to retrieve the parser files.
-
yeah how can i alter the timezone on my server to get it to the right time??
-
hello everyone my server shows the time as New Time: 12:47:48 but locally it shows it as New Time: 05:57:11 is there any reason for this, what can i do about i?? many thanks Garry
-
http://myshoutbox.thedesignmonkeys.co.uk/ can u please look at my shoutbox and give me advice. Garry
-
I have an SQL query that fetches all the entries in a database expect from the last one in the table...now i need to limit it to the last 10 records ordered by timestamp. can anyone help?? <?php include ('dbconnect.php'); $message = mysql_query("SELECT * FROM (SELECT * FROM chat ORDER BY timestamp DESC LIMIT 1,18446744073709551615) Deriv1 ORDER BY timestamp ASC "); while ($row = mysql_fetch_array($message)) { echo "<li><h2>".$row['nick'].": </h2><p class='word-wrap'>".$row['message']."</p></li>" ; } ?>
-
$message = mysql_query("SELECT * FROM (SELECT * FROM chat ORDER BY timestamp DESC LIMIT 1,18446744073709551615) ORDER BY timestamp ASC"); it says that the sql statement is not valid....
-
Yeah thats not working to well, i am order my results from top down...so using ASC. for example... 1 2 3 4 5 6 7 8 9 10 ----->> delete this one $message = mysql_query("SELECT * FROM chat ORDER BY timestamp DESC LIMIT 1,18446744073709551615"); with ur code it deletes 1 not 10 anymore ideas???
-
Hello can someone tell me how i can get every single row in the database EXCEPT the last one... i need a query to bring everything back from the db but not the last row?? thanks <?php include ('dbconnect.php'); $message = mysql_query("SELECT * FROM chat"); while ($row = mysql_fetch_array($message)) { echo "<li><h2>".$row['nick'].": </h2><p class='word-wrap'>".$row['message']."</p></li>" ; } ?>
-
Hi can someone steer me in the right direction I would like to know how to display my databases and count how many tables are in each and display them.. this is what i have. <?php include("./includes/dbconnect.php"); $sql = mysql_query("show databases"); while($row = mysql_fetch_array($sql)) { echo $row['Database']; } ?> i want something like information_schema(3) cdcol(4) mysql(2) phpmyadmin(7) test webauth
-
http://www.hiteshagrawal.com/javascript/showhide-html-elements-using-javascript
-
I have a function inside my Class called RetrieveBlog(), this retrieves the blog from the database what i want to do is be able to call the method without making a new instance ofthe class Blog. class.php <?php session_start(); class Blog { function __construct($blogtitle,$blogbody,$blogcreated,$createdby,$blogimg,$shortdescription) { $this->blogtitle = $blogtitle; $this->blogbody = $blogbody; $this->blogcreated = $blogcreated; $this->createdby = $createdby; $this->blogimg = $blogimg; $this->shortdescription = $shortdescription; } function CheckInput() { if(empty($this->blogtitle)) { header("Location: index.php"); $_SESSION['msg'] = "Please enter the title"; } else if(empty($this->blogbody)) { header("Location: index.php"); $_SESSION['msg'] = "Please enter the body"; } else if(empty($this->createdby)) { header("Location: index.php"); $_SESSION['msg'] = "Please enter your name"; } else if(empty($this->blogimg)) { header("Location: index.php"); $_SESSION['msg'] = "Please enter the Blog Image url"; } else if(empty($this->shortdescription)) { header("Location: index.php"); $_SESSION['msg'] = "Please enter the Short Description"; } else { $this->InsertBlog(); } } function InsertBlog() { $title = $this->blogtitle; $body = $this->blogbody; $created = $this->blogcreated; $createdby = $this->createdby; $blogimg = $this->blogimg; $shortdescription = $this->shortdescription; $sql = mysql_query("INSERT INTO blog(title,body,name,blog_img,short_description) VALUES ('$title','$body','$createdby','$blogimg','$shortdescription')"); $_SESSION['msg'] = 'Blog Created'; header("Location: index.php"); } function retrieveBlog() { $sql = mysql_query("SELECT * FROM blog"); while($row = mysql_fetch_array($sql)) { echo $row['title']; } } } ?> getBlog.php <? include("class_lib.php"); include("dbconnect.php"); $blog = new Blog(); $blog->retrieveBlog(); ?> Because im making a new instance, its going to the constructr... all i want to do is call on a method inside my class from a seperate document.