Search found 11 matches
- Sun Apr 01, 2012 5:16 am
- Forum: PHP
- Topic: PHP MySQL Select Query
- Replies: 2
- Views: 566
PHP MySQL Select Query
I am getting Resource id #7 from this query while i am trying to select the posts. $email = mysql_real_escape_string($email); $r = array(); $r = mysql_query("SELECT id AS id, url AS url, url_key AS url_key, date AS date, email AS email FROM urls WHERE email = '{$email}' ORDER BY date DESC"...
Re: Dev API
Ok so i put echo "{$head}{$post}"; above the frwite() and got this POST = /r2/api/a.php HTTP/1.0 Host: localhost Content-Type: multipart/form-data; boundary="8376698c1a6bf3046e88ba60fbb2cff0" Content-Length: 126 Connection: close --8376698c1a6bf3046e88ba60fbb2cff0 Content-Disposi...
Dev API
Ok so now i have a problem with the dev api tut here is my code <?php class url_shortener { const API_URL = 'http://localhost:8888/r2/api/a.php'; private static function send_post_data($data) { $url = parse_url(self::API_URL); $boundary = md5(microtime(true)); $post = ''; foreach ($data as $name => ...
Re: Php Blog
it is inserting 0/0/0000 00:00:00 always
Re: Php Blog
Ok. now I am having a problem with the mysql
NOW()function here is the query code
$sql = "INSERT INTO blog_posts (post_title, post_body, post_user, post_date, post_keywords, post_des) VALUES ('$title', '$body', 'Jason', 'NOW()', '$keywords', '$des')"; $add_post = mysql_query($sql);
Re: Php Blog
ok thank you that was the error
Re: Php Blog
i don't know
Re: Php Blog
ok so that is working but now i have this code giving me an error the comments.func.inc.php <?php function get_comments($pid) { $pid = (int)$pid; $sql = "SELECT comment_body AS body, comment_user AS user, DATE_FROMAT(comment_date, '%d/%m/%Y %H:%i:%s') AS date FROM comments WHERE post_id='$pid'&...
Re: Php Blog
thank you that is working now it turns out i did that twice in that same query now i know to look for and now i am able to watch the rest of the video. Thanks again
Jason
Jason
Re: Php Blog
this is the error
#1064 - 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 'FROM posts LEFT JOIN ( SELECT ' at line 9
Php Blog
Hello i have some code i copied from the php blog tutorial that is not working. Any help is accepted. <?php $connect = mysql_connect('localhost', 'root', 'root'); $databse = mysql_select_db(blog, $connect); echo mysql_error(); function valid_pid($pid) { $pid = (int)$pid; $total = mysql_query("S...