I use a form to send links to my site.
Its a link log type site.
I want to inform submitter when a link exist on database to avoid repetition.
table name is weblog column name is body in my MySql database.
How can I do that in php with a database query ?
Thanks
Trying to avoid repetition in database
Moderator: General Moderators
you might mark the field as unique. Atempts to add an equal entry will be rejected by msql.
Or you perform a query with the apropriate WHERE-clause. if mysql_num_rows returns a value !=0 there was an equal entry and you may show it.
Or you perform a query with the apropriate WHERE-clause. if mysql_num_rows returns a value !=0 there was an equal entry and you may show it.
are you sure you want to store the data that way?
You have to extract any link from the posted message either way, so you could easily store them in a different field or cross-linked table.
Anyway, maybe these two links are helpful
http://www.mysql.com/doc/en/String_comp ... tions.html
http://www.mysql.com/doc/en/Fulltext_Search.html
You have to extract any link from the posted message either way, so you could easily store them in a different field or cross-linked table.
Anyway, maybe these two links are helpful
http://www.mysql.com/doc/en/String_comp ... tions.html
http://www.mysql.com/doc/en/Fulltext_Search.html