Re: PROB WITH FINDING NEXT SEQUENTIAL NUMBER IN DATABASE FOR AN INSER T
| From: | Brian Clark | Date: | Mon, 20 Nov 2000 16:47:59 +0000 |
| Subject: | Re: PROB WITH FINDING NEXT SEQUENTIAL NUMBER IN DATABASE FOR AN INSER T | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26288@lists.php.net to get a copy of this message | ||
Hello Sonya,
(SD == "Sonya Davey / QDCEL") SonyaD@PQAfrica.co.za writes:
SDQ> HI, WOULD APPRCIATE ANY HELP ON THE FOLLOWING: IF I WANT TO GET
SDQ> THE NEXT SEQUENTIAL NUMBER(IE LASTCLIENTNO +1) FROM THE
I don't know a thing about InterBase, but a good place to start would
be to figure out how you can get the total number of rows, then loop
through the records with something *like*:
$rows = something_to_get_row_count();
for($i = 1; $i < $rows; $i++)
{
/* using your code below as a base */
$Query = "SELECT LASTCLIENT NO FROM CONTROL WHERE CODE=$i";
$Query_Result = ibase_query($Query,$connection);
$Row = ibase_fetch_row($Query_Result);
......
}
SDQ> CONTROL TABLE IN MY DATABASE TO DO AN INSERT INTO A DATABASE
SDQ> ASWELL AS PREFIXING THAT NUMBER WITH ADM,
Prefixing ADM is easy, but what is the column type set to? It it's set
to type integer then it probably won't accept a string as a value.
Again, I'm not familiar with InterBase so you're on your own there.
As for prefixing:
$varThatHoldsInt = 'ADM' . $varThatHoldsInt;
...Unless I don't understand what you're trying to do here.
SDQ> HOW WD I DO THIS?
SDQ>
SDQ> $SelectClientNumberDetailQuery="SELECT LASTCLIENTNO FROM CONTROL
SDQ> WHERE CODE=1";
SDQ> $SelectClientNumberDetailQuery_Result=ibase_query($SelectClientNumberDetailQ
SDQ> uery,$connection); $SelectClientNumberDetailRow =
SDQ> ibase_fetch_row($SelectClientNumberDetailQuery_Result);
SDQ>
SDQ>
SDQ> THANKS FOR ANY HELP!
Also I'd like to let you know that you're probably being ignored by a
lot of other knowledgeable people on this list because the whole
Subject line was in caps.
Your message was filtered into my SPAM mbox for that very reason.
Using all caps in e-mail is generally considered yelling.
-Brian