PHP array into Javascript Array

前端 未结 4 616
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-23 23:32

Afternoon all. The code below works perfectly, however, I need to pull each row of the php sql array out and into the script var. Any ideas on how to write a while loop that cou

4条回答
  •  感动是毒
    2021-01-24 00:14

    Pull your data out into a PHP array, then transfer that to JavaScript with

    var enableDays = ;
    

    As an aside, the obligatory recommendation that you should stop using the PHP mysql extension immediately because it is not very safe and has been deprecated; switch to something better (mysqli and PDO are both good choices).

提交回复
热议问题