/    Sign up×
Community /Pin to ProfileBookmark

Update query doesnt work

Hello,

Please advice me why this doesnt work? nothing landing in database
please code below I think so everything is okay. But 75 still not landing in database

<?php
if ($row_rsappointment[‘Bride1’] != $row_rsappointment[‘Bride2’]) {
echo $deposit = 75;

$con = mysql_connect(“localhost”,”root”,”krasnal”);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}

mysql_select_db(“database”, $con);

mysql_query(“UPDATE appointment SET DepositCost = ‘$deposit’
WHERE idAppointment = $_GET[‘idAppointment’]”);

mysql_close($con);

cheers
Seb

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@alifareediDec 01.2009 — [SIZE="5"][/SIZE]your idappointment is string it should be full in cotation like this

'$_GET[idAppointment]'


not like this

$_GET['idAppointment'][/SIZE][/SIZE][/B]
Copy linkTweet thisAlerts:
@Specht08Dec 01.2009 — Can you replace
[CODE]
mysql_query("UPDATE appointment SET DepositCost = '$deposit'
WHERE idAppointment = $_GET['idAppointment']");
[/CODE]

with
[CODE]
$sql = "UPDATE appointment SET DepositCost = '$deposit'
WHERE idAppointment = $_GET['idAppointment']";
echo $sql;
mysql_query($sql);
[/CODE]

and post the output here.

Maybe you update query is incorrect
×

Success!

Help @spacemoc 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.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...