jimmyslam
-
Posts
5 -
Joined
-
Last visited
Never
Posts posted by jimmyslam
-
-
I just followed other steps and is working now..
Thanks anyway! ;) -
Im triying to erase a row with this code.
[code] $id=$_GET['id'];
echo "#".$id." ";
$temp = intval($id);
$sql="DELETE * FROM news WHERE ID = $temp";
mysql_query ($sql);
[/code]
Why is not erasing? the ID table nad everything exists i dont get any error mensage either.
If I edit it works with this:
[code]$ID=$_GET['ID'];
$date=$_POST['Year']."-".$_POST['Month']."-".$_POST['Day'];
$description=$_POST['text'];
$linkN=$_POST['linkN'];
$linkURL=$_POST['linkURL'];
$sql = "UPDATE news SET date = '$date', description = '$description', linkN = '$linkN', linkURL = '$linkURL' WHERE ID = '$ID'";
mysql_query ($sql);
echo("UPDATED!!!");[/code]
If i try like this:
[code] $id=$_GET['id'];
echo "#".$id." ";
$temp = intval($id);
$sql="DELETE * FROM news WHERE ID = '$id'";
mysql_query ($sql);
echo ("ERASED");[/code]
it doesnt work either.
:-S :-\ -
Well the error is in this line:
[code]$sql->QueryRow("select * from news where 'ID'=1");[/code]
I think i tried doing
[code]$sql->QueryRow("select * from news where ID=1");[/code]
and didnt work either.
-
Ok i am having this error.
Fatal error: Call to a member function on a non-object in /datos/home/d177397/public_html/public_html/html/admin/view.php on line 14
And my code is
Vars!
[code]<?
define ( "DB_SERVER", "x.x.x.x" );
define ( "DB", "d177397_news" );
define ( "DB_LOGIN", "user..." );
define ( "DB_PASSWORD", "pass..." );
?>[/code]
Connect!
[code]<?
$db = mysql_connect(DB_SERVER, DB_LOGIN, DB_PASSWORD) or die("Could not connect: ".mysql_error());
mysql_select_db(DB) or die("Could not select database: ".mysql_error());
?>[/code]
[code]<?
include_once ("vars.php");
include_once ("connect.php");
//ver infos de las tablas
//$sql->QueryRow("select * from news where 'ID'=0");
$sql->QueryRow("select * from news where 'ID'=1");
$row = $sql->data;
echo ("$row[ID]");
echo ("$row[date]");
echo ("$row[description]");
echo ("$row[links]");
mysql_close();
?>[/code]
What is going on?
I think the queryrow is wrongly used. I dont see what is the problem really...
Anyone help? Thanks
Erasing elements with SQL DELETE WHERE
in MySQL Help
Posted