Jump to content

String checking and updating mysql


wiggst3r

Recommended Posts

Hi

 

I'm, trying to generate a string that has 7 chars. The first one must be 'f' and the remaining 6 have to be all uppercase alphanumeric and must not contain '0' (zero), i or O.

The script is to update a current row in a mysql database, which there is 150 rows. Each string must be unique, so I need some way of checking for the string in before I update each row.

 

Can anyone help me? Thanks

Link to comment
Share on other sites

I would generate an array of strings - you can check for a repeated string each time you generate a new one using in_array().

 

Then you can chuck the whole array into your MySQL table when you have finished.

 

I would think it would be easier than handling MySQL errors.

Link to comment
Share on other sites

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.