Laika1986 wrote: ( ! ) Notice: Undefined index: userid in C:\wamp\www\Connections\mybet.php on line 493
What this means is that the value [font=monospace]$POST['userid'][/font] or [font=monospace]$SESSION['userid'][/font] doesn't exist (it's not quite clear which is line 493).
For the former, check that you are POSTing a form, and that it does have a field named "userid". Likewise I guess for the other form fields you mention ("MM_update" and it wouldn't hurt to check "premierleague" as well). For the latter, I don't see anywhere that you assign any values to the [font=monospace]$_SESSION[/font] array (something you'll need to do if you want to find anything there).
Incidentally, you may have noticed from notices in the manual that using the MySQL extension is discouraged in favour of the or [url=http://www.php.net/ref.pdo-mysql]PDO interfaces. If you're just starting, it would pay to start with those instead - save picking up bad habits that you'd just have to break again later (and rewriting all that code when the extension is eventually dropped).
Hmm. Now that pastebin is up:
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
PHP hasn't even reached version 6 yet (and the check is wrong, since PHP_VERSION is a string, not an integer, and should be checked with a function like [man]version_compare[/man]). It's also wrong because, since PHP 5.4.0 [man]get_magic_quotes_gpc[/man] always returns false (because the configuration setting it checks was removed. On top of that, [man]mysql_real_escape_string[/man] has been around since PHP 4.3, so if you're using a version older than that you're in even bigger trouble - 4.2 hasn't been supported for a decade. Where did all that come from? (On top of it all: the whole thing is redundant given the newer interfaces I mentioned, which support parameterised queries, which do the appropriate quoting and escaping as needed.)