/    Sign up×
Community /Pin to ProfileBookmark

How To Edit?

Hi, im having problems again…i want to edit the information but it doesnt want to work..

in my edit page i send the information to a .php page that has the UPDATE function…but id doestn edit

<?php require_once(‘Connections/principal.php’);
$passid = $_GET[‘id’];
$pasdoc = $_
GET[‘doc_id’];
$pasnom = $_GET[‘nombre’];
$pasdir = $_
GET[‘direccion_fact’];
$miconexion = new Db(“webappdetec”,”localhost”,”webappdetec”,”webappdetecpass”) ;
$miconexion->consulta(“UPDATE clientes SET id= $passid ,doc_id= $pasdoc, nombre = $pasnom , direccion_fact= $pasdir WHERE id = $passid”);
?>

can somebody tell me where is the error?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@sitehatcheryAug 17.2006 — --Is direccion_fact a string or an integer? If string, you'll need to put quotes around it.

--Does your form use $_POST? You are trying to catch a $_GET variable.

--What message do you get when you write at the end of this script:

echo mysql_error();

--What does it look like when you echo:

echo "UPDATE clientes SET id= $passid ,doc_id= $pasdoc, nombre = $pasnom , direccion_fact= $pasdir WHERE id = $passid";

--Can the password include characters? If so, you'll need to put quotes around it.
Copy linkTweet thisAlerts:
@r4gn0authorAug 17.2006 — my form is using GET thats why im catching with $_GET the conection to the db is perfect it is working with adding and deleting i put the ' around $pasdir and nombre that are the fields that have Varchar but it isnt working

[code=php]<?php require_once('Connections/principal.php');
$passid = $_GET['id'];
$pasdoc = $_GET['doc_id'];
$pasnom = $_GET['nombre'];
$pasdir = $_GET['direccion_fact'];
$miconexion = new Db("webappdetec","localhost","webappdetec","webappdetecpass") ;
$miconexion->consulta("UPDATE clientes SET id= $passid ,doc_id= $pasdoc, nombre = '$pasnom' , direccion_fact= '$pasdir' WHERE id = $passid");
?>[/code]


here is the form action

[code=html]<form action="../confedc.php" method="get" name="form1" target="_self">[/code]

confedc.php is the page where the php code is
×

Success!

Help @r4gn0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...