ODBC to MySQL

admin

Administrator
Staff member
Can anyone give me an idea on how to convert this to MySQL? Just changing odbc_result to mysql_query isn't working like I had hoped it would.

<?
$SQL = odbc_exec("$conn","select * from PORTFOLIO_DATA where LOGIN='$login'");

if(odbc_fetch_row($SQL))
{
$redirect=odbc_result($SQL,"REDIRECT");
setcookie("id", odbc_result($SQL, "ID"));
}
else
{

$SQL=odbc_exec("$conn","select WRONG from WRONG_ID where ID=1");
$newwrong=odbc_result($SQL,'WRONG');
$newwrong=$newwrong+1;
$SQL=odbc_exec("$conn","update WRONG_ID set WRONG=$newwrong where ID=1");

$SQL = odbc_exec("$conn","INSERT INTO [WRONG_ID] (WRONG) VALUES ('$login')");
$newdate = date("F j, Y, g:i a");

}

?>
 
Back
Top