query problem
Posted: Thu Sep 14, 2006 9:42 pm
I have written this script using dreamweaver and my own novice knowledge of PHP. Between the two I have managed to cobble something together that actually does what I want it to do. It may not be the prettiest thing in the world and I am sure there are easier ways to accomplish what I have done, but it works...almost.
I have tested every step right up to the very end and I can echo the correct values onto the screen up to the last part where I try to push some of those values to my database. The problem seems to be with the one line where I construct my update query. If I remove that one line everything else up to that point works great. With it therre I get nothing, not even an error.
here is the section where I think the problem is. Can someone take a look?
this is at the top of the script and is being used successfully to make connections in other places
Then at the end I have what I think is my problem section
If there doesn't seem to be an obvious proble here then I can post the whole script to see if it is coming from somewhere earlier (I am hoping not since everthing else is working and I don't want to mess with it any more)
Your help is much appreciated
I have tested every step right up to the very end and I can echo the correct values onto the screen up to the last part where I try to push some of those values to my database. The problem seems to be with the one line where I construct my update query. If I remove that one line everything else up to that point works great. With it therre I get nothing, not even an error.
here is the section where I think the problem is. Can someone take a look?
this is at the top of the script and is being used successfully to make connections in other places
Code: Select all
<?php require_once('Connections/anthill.php');Code: Select all
$newsubstring =$newsubstring.$antrec;
$thisid = $row_userset['ID'];
mysql_select_db($database_anthill, $anthill);
$query_subst = sprintf("UPDATE users SET subs='%s' WHERE ID='%s'",
mysql_real_escape_string($newsubstring),
mysql_real_escape_string($thisid));
$subsreplace = mysql_query($query_subst, $anthill) or die(mysql_error());Your help is much appreciated