php - SQL Data & JavaScript - Best Practice -


let's website needs pull information specific table in database based on user's menu selection. table's data fed js equations , thrown onto page.

what best way go pulling table's information? i've read trying access sql database via javascript bad practice, there way this? know php's json_encode, guess i'm not entirely sure

  1. what syntax if i'm calling php js script, and
  2. if that's 'best' practice. still relatively new this, i'd right.

another option far i'm concerned attempting pull of possible tables (not security concern) @ once on page load. expect that'd introduce deal of latency, though.

it looks me not sure technique use. here options. i'm not going type them here because, there enough find each one:

plain php: w3schools

pure ajax call: stackoverflow

jquery: jquery

ajax calls more user friendly , many times more efficient because, don't have refresh page. information @ once( long mysql data not big). security: use php either way doesn't matter if use ajax or not. oh , don't select valuable data of users data (like password or emails). hope more overview after :)


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -