Jump to content

Recommended Posts

Hi,

 

We used to use a .NET and MSSQL database for our site, we are in the process of changing everything to PHP/MySQL.

 

On our previous setup we had an ID field that would create a string like the one below for each user that completed a form and auto insert it into the database.

 

dc2479e5-cdf1-4682-8efa-016bbf693426

 

Now my problem is this... I already have an auto increment field in the table, how do I ensure that this 'ID' field continues to insert this type of string onto every new entry?

 

Any help is really appreciated.

Link to comment
https://forums.phpfreaks.com/topic/170157-problem-with-id-string-in-mysql/
Share on other sites

Was that field created by MSSQL? i.e. a custom datatype? Because that's what it appears to be.

If so, you will have to create a trigger (in MySQL) to generate this, or (better option) get PHP to generate an ID along the lines of what you were getting before, and insert that into the table.

Hi,

 

Thanks for your reply.

 

Unfortunately, I have never used MSSQL and had no involvement personally in the creation of the MSSQL database, but from my understanding, yes this was a 'custom datatype'.

 

How do I create a trigger in MySQL to generate this? Or the better option of making PHP do it?

 

Thanks for your help so far!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.