I have mysql database contains two tables as follows:-

1. **ADS**
ads\_id
ads\_image
ads\_link
2. **ads\_viewed**
adsv\_id
adsv\_adsid
adsv\_ip
adsv\_timing

and when any user enters my website the ads loads by AJAX and add the visitor data to "ads\_viewed" table

now I want when viewing the ads to display random ads but from not viewed ads.

**EXAMPLE:** If I have four (4) ads,I viewed the ads number:#1 and #2 then it should view me one of these two ads #3,#4 then after finishing showing all ads, start the process from the beginning.

so I want the mysql query to do that.

thanks in advance.