Solved

PHP/MYSQL Insert

Posted on 2008-06-11
5
266 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
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.

828 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