You are right David, I have an auto_increment field!!
What about this:
$items2 = mysql_query("SELECT DISTINCT rev FROM rev ORDER BY rev", $link);
where rev is a revision field for parts in my wharehouse!!!
Does it will work in this case?
Thanks
-Original Message-
From: David Robley [mai
There is a function that gets the last auto increment value for an ID
field!!
-Original Message-
From: mayo [mailto:[EMAIL PROTECTED]
Sent: Martes, 17 de Mayo de 2005 10:27 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] multiple queries, one transaction
I would like to get the itemID nu
Well, for something like this you would need one row for each item.
I just did a db for a clothing store (with cold fusion)
itemID: 1001 // autoincrement
itemTypeID: 1 // number -- refers to "jeans"
itemDesignerID: 5 // number -- refers to designer "Antik"
itemSize: 32 // number -- refers to wais
Thanks, the $orderId = mysql_insert_id($result) was what I was looking
for.
But in the long run, I'm still concerned about how to group several
queries into one transaction. As for example when one wants to make
multiple inserts with one submit.
Ex: User wants to input inventory. He's going to p
* Mayo <[EMAIL PROTECTED]>:
> I'm new to PHP and would like to make certain that I have the basic
> protection for the site:
>
> Use double quotes to contain variable
This depends entirely on the variable type expected by MySQL; int and
floats don't necessarily need quotes. However, it's typical
I would like to get the itemID number (autoincrement) of the last
insert.
(Insert order, get last orderID number and use it elsewhere.)
I'm having trouble understanding how to do a transaction in mysql/php
Code below:
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die
('Error conne
distinc needs a field
select distinct(name) from table
bastien
From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Select
Date: Mon, 16 May 2005 19:26:20 -0700
Hi!!
I have this query in PHP:
$items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY re
Miguel Antonio Guirao Aguilar wrote:
> Hi!!
>
> I have this query in PHP:
>
> $items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY rev", $link);
>
> I have three rows with the same data on it, and DISTINCT seems to be not
> working, since I got all the rows, any ideas of what is going wro
What are you trying to connect to? Do you have a webservice on the second
domain? Is it a database - and if so, which?
-Original Message-
From: JeRRy [mailto:[EMAIL PROTECTED]
Sent: 17 May 2005 08:33
To: php-db@lists.php.net
Subject: [PHP-DB] Connection Question!
Hi,
Okay lets say I ow
We need to see your script or at least the portion where you do the query to
the database.
In general, you need to concatenate your different case-note for a given
student as the while cycle goes thru your fetch statement for such a given
student.
--
MIGUEL GUIRAO AGUIL
If you mean database access that is simple, just create
a user that has access only from localhost (and of course
remove the others).
For mysql just do the query :
"GRANT ALL PRIVILEGES ON your_database.* to 'user'@'localhost'
identified by 'password'".
If you mean http access then you can confi
John R. Sims, Jr. wrote:
> Martin; I have taken your advice and read both of the articles, but
> unfortunately I have not been able to find what needs to be changed. As I
> mentioned, I am very new at this.
>
> Could you possibly look at the script and point me in the right direction?
[snip]
>
Hi,
My question is about the norlmal behaviour of PHP and MYSQL but I cant
explain it without a simple example. Thank you for reading:
I have the following code:
-
Addresses should definitely have their own table.
Have you considered using Postgres? It allows for table inheritance in
much the same way that inheritance works in OOP. You could have a parent
table (like a parent class) for "People", and child tables (just like
child classes) for "Employee",
You have the string " ' \ "
With addslashes it becomes " '\ \\ "
When you insert it into the database
it goes into a query like this
"update table set field=' '\ \\ ' "
But that inserts into the field only " ' \ ",
in other words the original string.
It is a normal behaviour and you should
om
Acctually my problem was in that I was using the name of the table in
uppercase rather than in lowercase. So MySQL was looking for table REV
instead of rev. So for MySQL, REV and rev are very different tables!!
Regards,
Miguel Guirao
-Original Message-
From: Constantin Brinzoi [mailto:[E
'Yemi Obembe wrote:
>
> just care to know how php does the line counting when it echoes error
> messages like:
>
> parse error: unexpected '}' on line 129
>
> 1. does the "line counting" includes empty lines
yes.
> 2. are externally included files (using include(), require() etc) also "line
>
turn of magic quotes or test for it before using addslashes
Bastien
>From: "Petzo" <[EMAIL PROTECTED]>
>To: php-db@lists.php.net
>Subject: [PHP-DB] addslashes + stripslashes + mysql question
>Date: Mon, 16 May 2005 11:20:41 +0300
>
>Hi,
>
> My question is about the norlmal behaviour of PHP an
Hello,
I have some questions about DB_DataObject and FormBuilder PK handling, should
I post them here or do you know a better list?
TIA
--
Alessandro Pasotti
ICQ# 245871392
Linux User #167502
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.ph
Hi,
Okay lets say I own www.fred.com (which I don't but still) and
www.getpaid2reademails.com (so I own two domain, lucky me!)
Now I want to connect from getpaid to fred... Okay I have done this and
achieved this but is it possible to reject this operation and deny connections
outside of loc
Hi,
Instead of doing a SELECT *, specify the fields that you require. Allthough
you may think the rows are exactly the same, one might be empty ("") and one
null which is not the same.
You are more likely to get the result that you need if you specify the
fields:
SELECT DISTINCT somedata, rev, a
Can you send the query and some code that you're using? You probably want to
loop like this:
while ($row = mysql_fetch_assoc($cursor)) {
echo $row{"case_note"} . "";
}
Jos
-Original Message-
From: John R. Sims, Jr. [mailto:[EMAIL PROTECTED]
Sent: 17 May 2005 03:07
To: php-db@list
Personally, I always check variables that I'm using in a query. If I'm
expecting eg a session id (32 hex characters) I check that the session id is
a valid one - ie "!$[0-9a-f]{32}$!" (I use ! as delimiter in regexps).
Allthough mysql_escape_string will probably protects me from injections, I
stil
23 matches
Mail list logo