- Joined
- Sep 11, 2007
- Messages
- 295
- Reaction score
- 2
Hey Guys..
Well im having ALOT OF TROUBLE here and now im in desperate need in getting this done
can some one help me out a bit
this script is supposed to Search for the character name. If php finds the character name
odbc will fetch the row that the character's CID is in. Once it fetches the Character's CID well... it will search into the Table Called
Character Item
in character Item has the item id's for special weapons for a character. Once php finds the character item that corresponds with the correct CID of the row
it will delete the row and out put "row has been deleted"
But thats not happening for me unfortunately =[
here is the code
All im getting from ODBC_RESULT_ALL is
NO ROWS FOUND
so can some one sorta help xD i didnt finish the script because there is no point if php cannot find the row you want to work with.
Well im having ALOT OF TROUBLE here and now im in desperate need in getting this done
can some one help me out a bit
this script is supposed to Search for the character name. If php finds the character name
odbc will fetch the row that the character's CID is in. Once it fetches the Character's CID well... it will search into the Table Called
Character Item
in character Item has the item id's for special weapons for a character. Once php finds the character item that corresponds with the correct CID of the row
it will delete the row and out put "row has been deleted"
But thats not happening for me unfortunately =[
here is the code
Code:
<form action = <?php $_SERVER['PHP_SELF']; ?> "?act=delete" method = "post">
<br>
<br>
Character Name: <input type="text" name="name"/>
<br>
<br>
Current Item ID To Delete:
<br><br>
<input type="text" name="id"/>
<br><br>
<input type="submit" Value="delete Item" name="delete"/>
</form>
PHP:
<?php
$dsn = 'GunZDB';
$user = '';
$pass = '';
$conn = odbc_connect($dsn, $user, $pass) or die ('Cannot Connect To MSSQL Server');
function antiinj($sql)
{
$sql = strip_tags($sql);
$sql = htmlspecialchars($sql);
$sql = str_replace("'", "''", $sql);
$sql = str_replace("\"", "\"\"", $sql);
}
@$name = antiinj($_POST['name']);
@$id = antiinj ($_POST['id']);
$query = odbc_do($conn, "SELECT * FROM Character (nolock) Where (Name='$name')");
odbc_fetch_row($query);
$nick = odbc_result($query, (int)3);
$CID = odbc_result ($query, (int)1);
if($name == $nick)
{
$sql = odbc_do($conn, "SELECT * FROM CharacterItem Where CID = '" . $CID . "'");
odbc_fetch_row($sql);
$itemdelete = odbc_result($sql, (int)2);
odbc_result_all($sql);
}
?>
All im getting from ODBC_RESULT_ALL is
NO ROWS FOUND
so can some one sorta help xD i didnt finish the script because there is no point if php cannot find the row you want to work with.