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
https://forums.phpfreaks.com/topic/137074-string-checking-and-updating-mysql/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.