|
by: Sugapablo |
last post by:
Let's say I create a new record in a table like this:
mysql_query("INSERT INTO table (col1) VALUES ('example')",$conn);
....that had an auto-incrementing, unique identifying column named "ID"
that would be populated with a unique number upon insertion...
How can I get the unique number it assigned to that record returned for
futher use?
|
by: kain |
last post by:
hi there,
I'm currently converting a MySQL application to PostgreSQL, and I
hacked this app to support PEAR::Db .
after some good coding days, I've found a problem: mysql_insert_id on
pear::db .
I've those two piece of code, the first is part of a class:
---------
function connect($layer,$host,$db_port,$db_name,$user,$pass) {
$dsn = "$layer://$user:$pass@$host:$db_port/$db_name";
|
by: yawnmoth |
last post by:
how could i reduce the following piece of code:
for ($num=0;$num<50;$num++) {
mysql_query($db,"INSERT INTO whatever (stuff) VALUES (somevalue);";
mysql_query($db,"INSERT INTO sometable VALUES
(".mysql_insert_id().");";
}
to something where only two sql queries are made (as opposed to 100?).
ie. where the first line could be converted to something like this:
|
by: Ravenslay3r |
last post by:
I'm making a web-site thats backended by php-2-mysql. A common problem seems
to be when processing form data, I use information early in the form to
create a new record in a main table. I then immediately need the
auto_incremented Key-ID of the new record to put other information in
related tables.
In the past i've gotten that ID by just doing a SELECT with a WHERE that
matches all the values i've just INSERTED, but it seems a cumbersome...
|
by: opt_inf_env |
last post by:
Hi,
I would like to insert a data (row) into database (MySQL) and than to
generate file whose name contains the ID of the inserted row (ID is
declared as AUTO_INCREMENT). I wanted to extract ID by
mysql_insert_id() function. However, the problem is that my web site
can visit many users and many of them can initiate the describe
procedure. It can happen that between the first user inserts something
into database and executes...
|
|
by: monomaniac21 |
last post by:
Hi all
With regard to mysql's mysql_insert_id function is it possible that the
query can return the insert id from another insert performed by a
another user of the database which occured after the initial insert by
the first user but b4 the insert_id part can be queried.
Regards
|
by: Jankie |
last post by:
Hi and wish all moderators and members are doing well i
Back with a question after a long while,hope to find the valuable typical support from thescripts people and members.
My host does not offer foreign key feature on tables,so what I did is stick the corresponding submission id in the member's uploaded file when renaming the file.
Each member can upload up to 6 files.
Now,I'm clueless how to retrieve those matching images(or just 1...
|
by: svsenthilkumar |
last post by:
Hai,
i want to insert a record and retrieve id using php-mysql.
i want insert a record by copy of another one table.
after inserting i update a field in the inserted record.
so, can i insert a record and return the inserted record id.
(each record will insert by a unique id).
|
by: Fred |
last post by:
if my query is a regular INSERT, then mysql_insert_id() works as expected.
But if I use a Stored Procedure to do my insert, then mysql_insert_id() returns 0
How can I get a returned autoincrement (my primary key) when using a stored
procedure? Thanks.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|