Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

three pieces of php


ghost's Avatar
0 0

okay … I have been fine inserting data to an sql db from php and fine with displaying it … But … Delete and update have gotten me blank ….

someone point me in the right direction… i need something along the lines of ….

$id = $_post['entry id']; $pos = $_post['position'];

update position …. set pos to $pos where id = $id

I know thats no php code but thats what i basicly want it to do ….

Also … what is wrong with this script

$id = $_POST['id'];
include ("config.php");
database_connect();	

mysql_query("DELETE FROM perfect_nav WHERE id='$id'") 
or die(mysql_error());  
?>

Then i need a script that will … If config.php has already been included do nothing … if config.php has not been included include it …

Thanks Dotti.


SySTeM's Avatar
-=[TheOutlaw]=-
20 0
<?php
$id = mysql_real_escape_string( $_POST['id'] );
settype( $id, "int" );
include ( "config.php" );
database_connect();
mysql_query( "DELETE FROM `perfect_nav` WHERE `id` = '" . $id . "'" ) or die( mysql_error() );
?>

ghost's Avatar
0 0

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\delnav.php on line 2

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\delnav.php on line 2

I have definately declared the user details in config.php though :S


ghost's Avatar
0 0

System … Can you reccommend me a script or a layout for config.php file …. Becuase mine is a bit cluttered …


ghost's Avatar
0 0

[^&5^&5^756456464567]


ghost's Avatar
0 0

pm'd ;)