Help me plzz...
I insert data into pohonLatihan table from senarailatihan table. It done!!
But how can i insert the 'user id' that i capture from the 'session' into the same table.? - $no_pekerja = $_SESSION['user_id'];
-
-
$id_latihan=$_GET['id_latihan'];
-
-
-
$insert_query= "INSERT INTO pohonLatihan (namalatihan, tempat, t_mula, t_tamat, spesifikasi, jum_jam)
-
SELECT namalatihan,tempat,t_mula,t_tamat,spesifikasi, jum_jam
-
FROM senarailatihan WHERE id_latihan='$id_latihan'";
2 5018
you can have the variable in the SELECT statement
assume that you have a user_id column and you want to insert $no_pekerja to that here how it does - $insert_query= INSERT INTO pohonLatihan (namalatihan, tempat, t_mula, t_tamat, spesifikasi, jum_jam, user_id)
-
SELECT namalatihan,tempat,t_mula,t_tamat,spesifikasi, jum_jam, '$no_pekerja'
-
FROM senarailatihan WHERE id_latihan='$id_latihan'";
It works!! I'm just adjust...little bit more in coding..i'm really appreciate it!!!
**it look like this - $no_pekerja = $_SESSION['user_id'];
-
-
$id_latihan=$_GET['id_latihan'];
-
-
-
$insert_query= "INSERT INTO pohonLatihan (namalatihan, tempat, t_mula, t_tamat, spesifikasi, jum_jam, no_pekerja )
-
SELECT namalatihan,tempat,t_mula,t_tamat,spesifikasi, jum_jam,'$no_pekerja'
-
FROM senarailatihan WHERE id_latihan='$id_latihan'";
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Gansoinat |
last post by:
Hi,
During an insert command, i'm using @@IDENTIFIER to
obtain the key (auto increment colonne).
4 users insert record in the same time.
result :
user1 : Key=1
user2 : Key=2
user3 : Key=2...
|
by: adove |
last post by:
I am having problems with the following code. I am trying to update my db table Categories in Northwind. I have borrowed this code from www.dotnetjohn.com/articles/articleid27.aspx Although it...
|
by: Ross |
last post by:
Hi,
I want to run this query. The query runs fine but it always inserts
blanks into the temp database. Any suggestions would be appreciated.
DECLARE GLOBAL TEMPORARY TABLE temp_date (v_date...
|
by: Suler Abou |
last post by:
Hi,
I'm having a problem with an SQL statement, I have a statement that goes
like this:
"INSERT INTO table VALUES('TransID','CID',etc...);"
it basically adds new data to a table. When the...
|
by: Joe |
last post by:
Hello All,
I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message,
System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
...
|
by: fintudet |
last post by:
Hello.
During some experimentation with DB2 decimal numbers representations, I
have discovered very unexpected behaviour of the global temporary
table. Consider this example.
Such I had...
|
by: 4.spam |
last post by:
Hello.
v8.2.
Is it possible?
Example:
---------------
create function t(v varchar(1))
modifies sql data
returns table(c varchar(1))
|
by: davemcdonald |
last post by:
ASP Javascript (Dreamweaver) insert and retreive Primary Key
--------------------------------------------------------------------------------
Been pulling my hair out all week.
I am working on...
|
by: troydixon |
last post by:
Hello,
I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
|
by: AXRabbit |
last post by:
Hi, i am now doing a Car rental system web project. Well the interface is very similiar to http://www.avis.com.sg/, which i have extra modelname dropdownlist.
Here is my code.Label 7 is just a...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| | |