Jump to content

joquius

Members
  • Posts

    3
  • Joined

  • Last visited

joquius's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. yes, indeed I mean javascript and not java. My mistake. Purely javascript...no java.
  2. yes i'm actually well aquainted with these two.
  3. Just found this code quite useful for using predefined php values out of mysql, while using java to prevent reloading the page. Works exceptionally well.An example for an x,y key multidimensional array export:example array value; $array[3][4] = "#f0f0f0"; <?function load_schemes (){ if ($schemes = mysql_query ("select distinct `scheme` from `colors` where 1")) { while ($scheme = mysql_result ($schemes, 0)) { $result = mysql_query ("select * from `colors` where `scheme` = '$scheme'"); while ($_result = mysql_fetch_array ($result)) { $array[$_result['y']][$_result['x']] = $_result['color']; } ?><script type="text/javascript">var array_<?=$scheme?> = new Array()</script><? foreach ($array as $y => $value) { ?><script type="text/javascript">array_<?=$scheme?>['<?=$y?>'] = new Array()</script><? foreach ($array as $x => $_value) { ?><script type="text/javascript">array_<?=$scheme?>['<?=$y?>']['<?=$x?>'] = "<?=$_value?>"</script><? } } } }}?> I use this for colouring specific cells in a table with a large number of cells when you don't want to reload the table for each change. Once you export these you can then just reload different color arrays as needed within a java script.
×
×
  • Create New...