Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP/MYSQL Insert

Posted on 2008-06-11
5
Medium Priority
?
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

722 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