Jump to content
php.lv forumi

Pēdiās trūkst :(


hEiti

Recommended Posts

 

 $var ='SELECT * FROM darbi LEFT JOIN users ON darbi.autors_id=users.users_id LEFT JOIN objekti ON darbi.objekts_id=objekti.objekti_id WHERE izveidots>="2012-11-01" AND izveidots<="2012-11-30" AND autors_id=1373 AND kategorija=4';


echo '<body onload="listWorks(\'' . $var . '\');">';

 

 
Problēma taja kad, javascript nokarās, jo datumi ir pēdiņās. 
Vai kādam ir kāda laba ideja, kā no šī izvairīties?
 
Link to comment
Share on other sites

Protams ka nokaras, jo ieliec iekšā pats savu query un redzēsi kādēļ onload funkcija nestrādā

 

echo '<body onload="listWorks(\'SELECT * FROM darbi LEFT JOIN users ON darbi.autors_id=users.users_id LEFT JOIN objekti ON darbi.objekts_id=objekti.objekti_id WHERE izveidots>="2012-11-01" AND izveidots<="2012-11-30" AND autors_id=1373 AND kategorija=4\');">'; 

Šei sākas onload="listWorks ... un izveidots>="2012 un šeit viņš redz ka beidzas. Skatoties pēc " !

 

Bet kas tā par lietu ka caur JS sūta veselu query? Kaut kāds gateris. Tik pat labi es varu šo query pielabot un onload izpildīt savu query "DROP TABLE darbi".

Ieteiktu nosūtīt caur load kaut kādus parametrus un tur izveidot query lai nav redzams pats query.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...