Hello all,

I've been able to get the below to work pretty much. The only problem I have is when there is an apostrophe in the data of one of the fields like (You're the One). When this occurs nothing gets updated or inserted(tried both). I've done other things from forms inserting/updating with data that contained apostrophes and never had a problem. This is my first attempt at inserting/updating from a string match.
Any help would be appreciated.

$grab = preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $file, $matches);

$a_1 = $matches[3][48];
$a_2 = $matches[3][49];
$a_3 = $matches[3][50];
$sql = "UPDATE charts SET artist='$a_1' , song='$a_2' , label='$a_3' WHERE charts_id=1" or die(mysql_error());
if ($result = mysql_query($sql)){

Here is my table structure:
charts_id(tinyint(3),NOT NULL)

Thanks in advance,

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to