473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Limit Records created to one only

RT
I have a registration system that Iım working on that requires some
information to be entered only once (ie. Company name, cost & dates)
Does anyone know how I can set up in php so only one record is created in
the mySQL table and never anymore. I also want the end user to be able to
edit this information if needed .
Thanks

RT

Jul 17 '05 #1
4 1967
Limit Records created to one only
"RT" <ro******@comcast.net> wrote in message
news:BC96E92F.EEFB%ro******@comcast.net...
I have a registration system that I'm working on that requires some
information to be entered only once (ie. Company name, cost & dates)
Does anyone know how I can set up in php so only one record is created in
the mySQL table and never anymore. I also want the end user to be able to
edit this information if needed .
Thanks

RT

1) No HTML please, we're Usenet.
2) Look up "unique keys". I assume you want a single record per customer, so
you'll have to decide on what makes each customer "unique" (name, customer
ref or something) and make that field UNIQUE when you CREATE the TABLE.
Attempts to INSERT the same key value twice will then fail. You can always
look it up yourself first of course, but this is the SQL way.
3) This isn't a PHP question after all! Aren't you lucky.

Garp
Jul 17 '05 #2
RT
On 4/5/04 6:22 PM, in article
P_*********************@news-text.cableinet.net, "Garp"
<ga***@no7.blueyonder.co.uk> wrote:
Limit Records created to one only
"RT" <ro******@comcast.net> wrote in message
news:BC96E92F.EEFB%ro******@comcast.net...
I have a registration system that I'm working on that requires some
information to be entered only once (ie. Company name, cost & dates)
Does anyone know how I can set up in php so only one record is created in
the mySQL table and never anymore. I also want the end user to be able to
edit this information if needed .
Thanks

RT

1) No HTML please, we're Usenet.
2) Look up "unique keys". I assume you want a single record per customer, so
you'll have to decide on what makes each customer "unique" (name, customer
ref or something) and make that field UNIQUE when you CREATE the TABLE.
Attempts to INSERT the same key value twice will then fail. You can always
look it up yourself first of course, but this is the SQL way.
3) This isn't a PHP question after all! Aren't you lucky.

Garp

Actually I figured it out by placing a query manually into the code only to
look at the first record only. Don't know if this is the right way but it
seems to work.

Thanks for input

RT

Jul 17 '05 #3

"RT" <ro******@comcast.net> wrote in message
news:BC97F28F.F3D2%ro******@comcast.net...
On 4/5/04 6:22 PM, in article
P_*********************@news-text.cableinet.net, "Garp"
<ga***@no7.blueyonder.co.uk> wrote:
Limit Records created to one only
"RT" <ro******@comcast.net> wrote in message
news:BC96E92F.EEFB%ro******@comcast.net...
I have a registration system that I'm working on that requires some
information to be entered only once (ie. Company name, cost & dates)
Does anyone know how I can set up in php so only one record is created in the mySQL table and never anymore. I also want the end user to be able to edit this information if needed .
Thanks

RT

1) No HTML please, we're Usenet.
2) Look up "unique keys". I assume you want a single record per customer, so you'll have to decide on what makes each customer "unique" (name, customer ref or something) and make that field UNIQUE when you CREATE the TABLE.
Attempts to INSERT the same key value twice will then fail. You can always look it up yourself first of course, but this is the SQL way.
3) This isn't a PHP question after all! Aren't you lucky.

Garp

Actually I figured it out by placing a query manually into the code only

to look at the first record only. Don't know if this is the right way but it
seems to work.

Thanks for input

RT


OK, I don't understand what you did, but by the sound of it, neither do you,
and that's storing up problems for later. At the very least, try to find the
company you want to insert first (with SELECT), and don't bother putting it
in if that returns anything.

Best of luck,
Garp
Jul 17 '05 #4
Limit Records created to one only>"RT" <ro******@comcast.net> wrote in
message news:BC96E92F.EEFB%ro******@comcast.net...
I have a registration system that I'm working on that requires some information to be entered only >once (ie. Company name, cost & dates)Does anyone know how I can set up in php so only one record is created in

the mySQL table and >never anymore. I also want the end user to be able to
edit this information if needed .

You would use REPLACE keyword for something like that, I think.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Randell D. | last post by:
Folks, I have a SELECT that returns with multiple records - It works when I have a LIMIT clause but when I try to include a GROUP BY clause, the select returns nothing (ie no records, no...
0
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ?...
2
by: Dalan | last post by:
I have created a table and form for allowing the input of a unique customer number (not an ID autonumber number) which a customer would enter once after installing the database. I'm using DLookup...
6
by: Hannu | last post by:
Hi. In the ldb file you can see the users of the mdb-file. If you open the mdb-file your machine and username will be written in the lbd- file. Allthough you close the mdb-file your name won't...
9
by: Sharktyyfa | last post by:
Hi, hoping someone can help. Access 2003, WinXP. I have built a database that uses synchro to co-ordinate with the mothership. All is well. The person i built it for wants the satellites...
3
by: deko | last post by:
Is there any way to limit the number of records loaded into a ListBox? I looked at qdf.MaxRecords (to apply to the query that is the RowSource of the ListBox) but that only applies to ODBC data...
10
by: Thelma Lubkin | last post by:
My form/subform combination that allows user to display 'ColorSet' records, move to other records via a selector, to add,delete, and edit them, and to manage the related 'Color' records from the...
1
by: Gurpal | last post by:
I'm getting this error when I test this page. Here is the error: Response object error 'ASP 0251 : 80004005' Response Buffer Limit Exceeded /test/test4.asp, line 0 Execution of the ASP...
1
by: dfw1417 | last post by:
I have used a query and report filter to return records related to a specific account id. I want to print a report including only the latest 6 records out of the set returned by the record filter. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.