This topic is locked

checking for a duplicate record before adding a record

9/4/2006 1:30:00 PM
PHPRunner General questions
T
thesofa author

I have had to use a compound primary key in a table, the key consits of `detainee`, `DayForDetention` and `sess`

When trying to avoid the PHP error box if a user tried to save a duplicate record, I decided to use the "Check if specific record exists"

All went fine until I started to build up the query string using the three fields, getting thie values from the `$values[]` array

Then I found all sorts of errors coming up, after a long time pulling hair out, I tried assigning three new variables with the values from the $values() array and using the variables in the query string.

Blow me down with a feather, it all worked fine.

Perhaps we could have a few more little hints to the PHP beginners amongst us about little tips like this, it would have saved me hours if there had been a multiple key example in the help file <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=3337&image=1&table=forumtopics' class='bbc_emoticon' alt=':D' />

Thanks again for a magic product

J
Jane 9/5/2006

George,
thank you for sharing your idea.

But your code is too specific.

We give only sample code in the PHPRunner Help.

To customize event code you can use PHP tutorials or find some examples on the forum.

T
thesofa author 9/6/2006

George,

thank you for sharing your idea.

But your code is too specific.

We give only sample code in the PHPRunner Help.

To customize event code you can use PHP tutorials or find some examples on the forum.



try here

a recent post on checking compound keys