Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP/MYSQL Insert

Posted on 2008-06-11
5
Medium Priority
?
288 Views
Last Modified: 2013-12-13
The following line works with session variables:

 $sql_inlogfastpax = 'INSERT INTO inlogfastpax (login_id,login_company,login_username,login_ipad,login_datereg, REGISTERED_PC, login_cookie) VALUES ('.$_SESSION['kt_login_id'].',"'.$_SESSION['kt_login_company'].'","'.$_SESSION['kt_login_user'].'","'.$_SERVER['REMOTE_ADDR'].'","'.date('Y-m-d H:i:s').'","'.$_SESSION['zzz'].'","'.$_SESSION['sess_varck'].'")';

Need to change the last item $_SESSION['sess_varck'] to plain $varck and cannot get it to work.

Any help please?
0
Comment
Question by:smudgemouse
  • 3
5 Comments
 
LVL 4

Expert Comment

by:albuitra
ID: 21761732
i don't understand what you want.
Do you copy $_SESSION['sess_varck'] to  $varck , and then replace in PHP ?


$varck  = $_SESSION['sess_varck'] ;
$sql_inlogfastpax = 'INSERT INTO inlogfastpax (login_id,login_company,login_username,login_ipad,login_datereg, REGISTERED_PC, login_cookie) VALUES ('.$_SESSION['kt_login_id'].',"'.$_SESSION['kt_login_company'].'","'.$_SESSION['kt_login_user'].'","'.$_SERVER['REMOTE_ADDR'].'","'.date('Y-m-d H:i:s').'","'.$_SESSION['zzz'].'","'.$sess_varck.'")';

Open in new window

0
 
LVL 4

Expert Comment

by:albuitra
ID: 21761744
Try with the two options, and print everyone to see the diferencees between those
0
 

Author Comment

by:smudgemouse
ID: 21764096
No. I don't want to use a session variable, just the variable $varck.

I am asking how to re-write the phrase:
,"'.$sess_varck.'"
0
 
LVL 4

Expert Comment

by:albuitra
ID: 21764169
I don't understand what you want
Do you have session variable sess_varck ?
Or do you have a variable varck ?
or do you have a session variable sess_varck and wnat to pass to varck  ?

If you only want to rewrite the query, it could be something like this

$sql_inlogfastpax = 'INSERT INTO inlogfastpax (login_id,login_company,login_username,login_ipad,login_datereg, REGISTERED_PC, login_cookie) VALUES ('.$_SESSION['kt_login_id'].',"'.$_SESSION['kt_login_company'].'","'.$_SESSION['kt_login_user'].'","'.$_SERVER['REMOTE_ADDR'].'","'.date('Y-m-d H:i:s').'","'.$_SESSION['zzz'].'","'.$varck.'")';
 

Open in new window

0
 
LVL 3

Accepted Solution

by:
Bivek-jos earned 2000 total points
ID: 21767522
Hi
I think this will work
$sql_inlogfastpax = 'INSERT INTO inlogfastpax (login_id,login_company,login_username,login_ipad,login_datereg, REGISTERED_PC, login_cookie) VALUES ('.$_SESSION['kt_login_id'].',"'.$_SESSION['kt_login_company'].'","'.$_SESSION['kt_login_user'].'","'.$_SERVER['REMOTE_ADDR'].'","'.date('Y-m-d H:i:s').'","'.$_SESSION['zzz'].'",'$sess_varck')';

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question