Rick Emery wrote:
what appeared when you printed the text of your query:
$query = "update bloggers set cache='$blog', title='$title' where url='$address'";
print $query;
I'm thinking that your single quotes preventd $blog, $title, $address form being expanded.
----- Original Message ----- From: "Jesse Lawrence" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 10:27 AM
Subject: [PHP] Mysql update problems
I've been scratching my head over the following code
for a while now. It's supposed to check a given
weblog for specific tags, and if they're present,
update the weblog's table in my database. I believe
the problem is around the execution of the db query,
but I can't seem to get it figured out.
function is_news($address, $blogtitle, $host, $user,
$pass, $dbname){
$f = fopen($address, 'r');
$read = fread($f, 20000);
fclose($f);
$title_start = strpos($read, "<BCtitle>");
$title_end = strpos($read, "</BCtitle>");
$title = substr($read, $title_start, ($title_end -
$title_start));
$blog_start = strpos($read, "<BCblog>");
$blog_end = strpos($read, "</BCblog>");
$blog = substr($read, $blog_start, ($blog_end -
$blog_start));
$link = mysql_connect($host, $user, $pass) or die("Can't connect to
database");
$query = "update bloggers set cache='$blog',
title='$title' where url='$address'";
if(mysql_db_query ($dbname, $query, $link)) {
$is_news = 1; }else{
$is_news = 0;
}
return $is_news;
}
Thanks a million for any help,
Jesse Lawrence
______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php