Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 7:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: POST WEB DATA: update record via SLQ ??
PostPosted: June 15th, 2009, 10:31 pm 
Offline

Joined: May 20th, 2006, 4:53 pm
Posts: 43
Location: Italy
Opus: Opus Pro 7.01
OS: Windows 7
hi,
i've a question,
i'he a opus pro pubblication that run on web, i create a "post Web Data" command to insert, login the data to from internet,
so, i would create a php script that allows me to update a record to web.
i'm create this script file to insert a new record to DB and work good from pubblication.

<?php

$nome_cognome = $HTTP_POST_VARS['nome_cognome'];
$loc_corso = $HTTP_POST_VARS['loc_corso'];
$user = $HTTP_POST_VARS['user'];
$password = $HTTP_POST_VARS['password'];
$SCORE_VALUE = $HTTP_POST_VARS['SCORE_VALUE'];
$SCORE_CORRECT = $HTTP_POST_VARS['SCORE_CORRECT'];
$SCORE_INCORRECT = $HTTP_POST_VARS['SCORE_INCORRECT'];
$NONCONFERMATE = $HTTP_POST_VARS['NONCONFERMATE'];
$ESITOFINALE = $HTTP_POST_VARS['ESITOFINALE'];
$timer = $HTTP_POST_VARS['timer'];

$DBhost = "11.111.111.11";
$DBuser = "1111111";
$DBpass = "1111111";
$DBName = "11111111";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "INSERT INTO simupekit (nome_cognome, loc_corso, user, password, SCORE_VALUE, SCORE_CORRECT, SCORE_INCORRECT, NONCONFERMATE, ESITOFINALE, timer) VALUES ('$nome_cognome','$loc_corso','$user','$password','$SCORE_VALUE','$SCORE_CORRECT','$SCORE_INCORRECT','$NONCONFERMATE','$ESITOFINALE','$timer')";
$result = mysql_query($query, $connect);

?>


and this for login:

<?php
$user = $HTTP_POST_VARS['user'];
$password = $HTTP_POST_VARS['password'];

$DBhost = "11.111.111.11";
$DBuser = "1111111";
$DBpass = "1111111";
$DBName = "11111111";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "SELECT * FROM simupekit WHERE user='$user' AND password='$password'";
$result = mysql_query($query, $connect);

$row = mysql_fetch_array($result );
$data = "&nome_cognome=".$row['nome_cognome']."&loc_corso=".$row['loc_corso']."&password=".$row['password']."&SCORE_VALUE=".$row['SCORE_VALUE']."&idpartecipante=".$row['idpartecipante'];
echo $data
?>


...how can i create a script that allows me to update a record?

thanks
_________________

_________________
Software: Opus v7.01
OS: Windows 7 64 bit
Hardware: In progress


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 16th, 2009, 3:40 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
The syntax will probably depend on the SQL database you're using but it'll likely be the update command.

Chris Fehily of VQSG fame has been nice enough to release the 2nd edition copy of his SQL book for free. Just click the excerpt link and download the book then use the chm search to locate 'update'

http://www.fehily.com/index.htm

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 16th, 2009, 8:39 pm 
Offline

Joined: May 20th, 2006, 4:53 pm
Posts: 43
Location: Italy
Opus: Opus Pro 7.01
OS: Windows 7
well i'll see.
thanks


mackavi wrote:
The syntax will probably depend on the SQL database you're using but it'll likely be the update command.

Chris Fehily of VQSG fame has been nice enough to release the 2nd edition copy of his SQL book for free. Just click the excerpt link and download the book then use the chm search to locate 'update'

http://www.fehily.com/index.htm

Mack

_________________
Software: Opus v7.01
OS: Windows 7 64 bit
Hardware: In progress


Top
 Profile Visit website  
 
 Post subject: i'm found a good solution!
PostPosted: June 17th, 2009, 10:30 pm 
Offline

Joined: May 20th, 2006, 4:53 pm
Posts: 43
Location: Italy
Opus: Opus Pro 7.01
OS: Windows 7
Well, i'm resolvig now:)



<?php

$idpartecipante = $HTTP_POST_VARS['idpartecipante'];
$nome_cognome = $HTTP_POST_VARS['nome_cognome'];
$loccorso = $HTTP_POST_VARS['loccorso'];
$user = $HTTP_POST_VARS['user'];
$password = $HTTP_POST_VARS['password'];

$DBhost = "1111111111";
$DBuser = "11111111111";
$DBpass = "11111111111";
$DBName = "111111111";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "UPDATE simupekit SET nome_cognome='$nome_cognome', loccorso='$loccorso', user='$user', password='$password', ESITO1='$ESITO1' WHERE idpartecipante='$idpartecipante'";
$result = mysql_query($query, $connect);

?>

_________________
Software: Opus v7.01
OS: Windows 7 64 bit
Hardware: In progress


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group