e.g.

i have 4 images... i'm trying to do onclick i swap id's(mysql) with the next onclick(image)..


basically just swap id's but its activated by javascript onclick. the javascript part is what i'm having trouble with because you can't write mysql statements in a function..


any help

What are you actually trying to achieve?

If it is just a question of shuffling images around on the page, then there's no need to involve the database unless you need to get the url of a new image. And even then, there may be ways to avoid the need to go back to the server (and hence the database).

Remember at all times : SQL statements run server-side. Javascript runs client-side (in the browser). Javascript can only initiate server-side activity by making a request (either conventional or AJAX).

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.