Forums

PHP

This topic is locked

using mysql_insert_id function w/ PHAkt...

Posted 13 Aug 2001 21:46:27
1
has voted
13 Aug 2001 21:46:27 crazy larry posted:
Hello,

This function returns the auto-incremented value that was inserted. It has one paramater, the database link.
When using PHAkt, what is the link?
What variable is it?

EX.
$link_id = db_connect('sample db');
$results = mysql_query('sample insert');
$usernumber = mysql_insert_id($link_id);

WHAT IS $link_id when using PHAkt?


Actually, can anyone step through how
PHAkt actaully works? I know what it is
doing, but don't know how it is doing it.

THANKS <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Replies

Replied 13 Aug 2001 22:05:57
13 Aug 2001 22:05:57 Tim Green replied:
PHAkT actually works in exactly the same way as the other server models in UltraDev, so for a step through I would suggest you read the UD Documentation. The principle of usage is exactly the same.

To retrieve the information you require, first create a connection, then create and then use the inert record behaviour.

To retrieve the InsertID, you just need to add a line like the following :-

&lt;?php
echo $ConnectionName-&gt;InsertID();
?&gt;

Hope this helps.


Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 13 Aug 2001 22:25:35
13 Aug 2001 22:25:35 crazy larry replied:
thanks Tim....

I will take a look at the documents, BUT...
I don't know what PHAkt is doing, meaning:

With PHAkt, I don't create the connection or the select statements. It is all done with the GUI and I want to modify the code a little bit. I don't know where or what the connection name is?

Since it creates a lot of the code for me, I am at a little loss because I don't know exactly what it did create.

I'm new to PHP,PHAkt, and UD4, so bare with me. I have a few books and I learning as fast as I can.


Do you happen to know of any documents on PHAkt?

Thanks for your help.
Larry

Replied 13 Aug 2001 22:50:21
13 Aug 2001 22:50:21 Tim Green replied:
Larry,

No worries. When you create a connection, the actual file containing the connection information is stored in the Connections folder in your web root. The actual file name will be in the order ConnectionName.php

I would advise though, that you don't make too many amendments to this file, as this could cause you problems at a later date, due to the way that UD works.

As well as the Connections folder, another folder is created called adodb. This folder contains the ADODB wrapper library, and for all DB access to function (even in Live Data view) you need to ensure that these two folders are uploaded to your webserver.

I appreciate you are new to this way of working, but I'm sure that once you get used to it, you will see the benefits of working in this environment.

Some extra reading, that will be of great use to you is the Readme.htm file in the ADODB folder, which details the command set that you can use when dealing with DB Access. As yet, not all of the functionality of ADODB is incorporated into PHAkT, though it is coming. It is one of my personal aims to make sure that the majority of the ADODB commands are implemented in some way.

Unfortunately, as yet, there is no PHAkT-specific documentation. I have tried to cover as much ground as possible with the tutorials I have placed at this site dealing with connections.

If you have any specific requirements regarding tutorials for PHAkT then I will gladly look into them, and as always you can find whatever help you need right here.

Happy PHAkT-ing !


Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 13 Aug 2001 23:18:23
13 Aug 2001 23:18:23 crazy larry replied:
ALL RIGHT!!!!!!!!!!!

I'm PHAkt-ing NOW.

That's the documentation I needed!!!

(( I solved my problem with your help ))

So, lets see if I got this right?

1. root/connection is what PHAkt uses to connect to the DB. (don't mess with)

2. root/adodb is all the functions,etc. that PHAkt uses to deal with the DB (look at, but don't mess with, because ADO is like a standard thing.)

3. I use myconnection-&gt;(ADO function name) to access the database and so does PHKat.
Question: what is '-&gt;' do or mean?

Thanks,
I wish I found this forum about 2 weeks ago!!

Say Tim,
Do you watch this/monitor this forum? As in it is your job? What hours do you do this?
You are a life saver!!!

THANKS again

Replied 13 Aug 2001 23:47:26
13 Aug 2001 23:47:26 Tim Green replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
1. root/connection is what PHAkt uses to connect to the DB. (don't mess with)
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Absolutely right.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
2. root/adodb is all the functions,etc. that PHAkt uses to deal with the DB (look at, but don't mess with, because ADO is like a standard thing.)
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Again absolutely right. Sometimes this library is updated, and I maintain an extension (exclusively available at this site) called ADODB Installer. When a new version is released I update this extension so you can always be sure of the latest version.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
3. I use myconnection-&gt;(ADO function name) to access the database and so does PHKat.
Question: what is '-&gt;' do or mean?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
The '-&gt;' refers to either a PHP Class variable or function. It is used when using Object Orientated programming with PHP. It sounds complex, but is actually extremely easy to use.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks,
I wish I found this forum about 2 weeks ago!!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Glad that I could be of help ! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Say Tim,
Do you watch this/monitor this forum? As in it is your job? What hours do you do this?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Yes, I watch/monitor this forum as I am one of this Forum's administrators, but it isn't my job, and I don't get paid for this.

I maintain a full-time job working as IT Manager, Web Designer, and Technical Liaison for an Aerospace Trade Association representing 750 companies in the UK. However, I also invlove myself with other projects (I'm on the IMPAkT and NeXTensio development team), and also write various extensions for use with the PHAkT PHP Server Model.

As for the hours that I do this ? Well, I usually check the Forum every hour or so between 9am and 2am GMT, unless I am really really busy.

Glad that you're with us, welcome to the Community.

All the best

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Edited by - rawveg on 08/13/2001 23:48:03

Edited by - rawveg on 08/13/2001 23:50:05

Reply to this topic