Solved

PHP/MYSQL Insert

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

776 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