-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
having read this http://support.google.com/mail/bin/answer.py?hl=en&answer=78799 and successfully connecting myself as I said in my last post - yeah, we're sure
-
that's just really lazy coding, see what this get's you back, after you change the bits in <> for the if at the end. function previously_liked ($article_id) { $article_id = (int) $article_id; $sql = "SELECT COUNT(`like_id`) FROM `likes` WHERE `like_id` = {$_SESSION['user_id']} AND `article_id` = $article_id"; $qry = mysql_query($sql) or die("could not perform the following query:<br>\n $sql<br>\n <br>\n The folowwing error was returned from the server:<br>\n".mysql_error()); $result = mysql_result($qry) if ($result == <whatever your trying to do>){ $result = <whatever you want it to be>; } else{ $result = <the other thing>; } return $result; }
-
yip, <?php /** You PHP Code */ ?> Your HTML <?php /** More PHP Code */ ?> BUT there are other ways, fling this into a new php file and run it: <?php $var = "variables"; $message = <<<HTML_MSG <html> <head><title></title></head> <body> <p>You'll find these string blocks rather handy at times like this</P> <table border="1"> <tr> <th colspan="2">Easy way to use string blocks in php</th> </tr> <tr> <td>1: make a variable and set it = to</td> <td>2: Openm the string block with <<<NAME_OF_BLOCK using that format(no spaces)</td> </tr> <tr> <td>3: Enter your formated string, including php $var if you want them</td> <td>4: Close the string block with NAME_OF_BLOCK; - on it's own line with no white space before or after it</td> </tr> </table> </body> </html> HTML_MSG; echo $message; ?>
-
I used this to connect to my gmail successfully: $mbox = imap_open ("{imap.gmail.com:993/imap/ssl}INBOX", "[email protected]","MyEmailPassword", OP_READONLY) or die ("can't connect: " . imap_last_error());
-
how about this? (You will need to change the <[email protected]> to an actual email address without the <> around it) $mbox = imap_open ("{imap.gmail.com:993/imap/ssl/authuser=<[email protected]>}INBOX", "username","password", OP_READONLY) or die ("can't connect: " . imap_last_error()); your /novalidate-cert/norsh switches are for self signed servers, I'm pretty sure google has an authorised certificate or 10 so this isn't needed.
-
...and the error is???
-
please could you comment on my comments OOP beginner!
Muddy_Funster replied to wright67uk's topic in PHP Coding Help
As your post was to comment on your comments, all I'd suggest is maybe including a doc block for each class with the declarations in it. I've just started looking into the OOP side of things myself and one of the things I have come accross is that, in some API implimentations, these doc blocks are really rather important for some DI patterns. One of the newer (newest?) ZEND releases can be coded to build refferences automaticly using the doc blocks as a kind of catalogue (that's my interpretation anyway, but like I said I'm new to this OOP thing too) for building the DI relations. I suck at OOP, having just started playing with it and coming from more than a few years in the procedural world, so I can't really say more than that. I'm sure one of the better programmers will corect what I've got wrong and clear up the bit's I didn't. -
PHP Sessions Across External Domains???
Muddy_Funster replied to jortega2's topic in PHP Coding Help
what are the forms on the remote end? are they your own forms or proprietry for the domain? Gonna need to know more about what you are working with to establish an accurate solution. Can we see some sample form code? Have you thought about embeding the forms in your own page(s)? -
no worries
-
Help! Need to show files in database by date order on webpage
Muddy_Funster replied to roytheboy's topic in MySQL Help
Why would you think to store dates as anything other than a date datatype? Best way to fix your problem is to fix your data. -
try TRUNCATE (tablename)
-
From what I read here: http://forumtopics.org/busobj/viewtopic.php?p=699540&sid=f419f6d2af088d5120d21f7908cc859d There is no way to link directly, but it can be done with a SOAP connection to a java web service
-
Sorry, I don't follow
-
PHP Sessions Across External Domains???
Muddy_Funster replied to jortega2's topic in PHP Coding Help
Nothing about anything you said explains why you would need to carry a session accross domains. Why does it need to be a session? Why do the scripts need to be on different domains? -
$updCount = mysql_affected_rows($update_postcodes); echo $updCount; mysql_affected_rows() returns the number of rows affected by an update/insert query, kind of like mysql_num_rows() does for select queries.
-
Kind of. It does sounds large if your thinking about it in human terms, like sheets of paper, or post-it notes sticking on your desk. For a databse, as long as there is sufficient disk space and it's set up right at the start, it's actualy really small (how many entries do you think the google DB has in a given table?). And before long term concerns creep in, you can always archive the records off into a series of aged tables every day/month/year/decade depending on what's easiest for your requirement.
-
looks spot on
-
Date field identifier would be my method of choice
-
Personaly I use echo "<tr><td>$var1</td></tr>"; without the . concat you're using
-
you will either need to add a submit button to the form or use a javascript/AJAX onChange event handler. You also really should close that first OPTION that you hardcoded into the HTML.
-
try $timestamp = $myrow["t_stamp"]; $format='F j, Y, g:i a'; $formatedTime = date($format, strtotime($timestamp));