Solved

PHP/MYSQL Insert

Posted on 2008-06-11
5
241 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
Comment Utility
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
Comment Utility
Try with the two options, and print everyone to see the diferencees between those
0
 

Author Comment

by:smudgemouse
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now