Kā var panākt lai "case" un "ba" izvelk ID no datubāzes? Ja "case" un "ba" ir 7 tad viss ir ok, savukart ja pie ID ir kads cits skaitlis tad attiecigi izvelk citu ID tas Javaskripts.
javaskripc.js
function peleVirsu(a)
{
switch (a){
case 7: {document.ba7.src ="attels1.jpg"}
break
}}
function peleAra(a)
{
switch (a){
case 7: {document.ba7.src ="attels2.jpg"}
break
}}
PHP
<?php
$result = mysql_query("SELECT id, text, insert_data FROM tbl_arhivs_years ORDER BY insert_data;");
if (!mysql_num_rows($result)) {
echo "Nav datu!";
} else {
while ($row = mysql_fetch_assoc($result)) {
extract($row, EXTR_PREFIX_ALL, "mb");
echo "<tr align=\"center\"><td align=\"center\"><a id=\"link1_text\" href=\"index.php?view=arhivs&MBID=$mb_id\"
onmouseover=\"peleVirsu($mb_id)\" onmouseout=\"peleAra($mb_id)\"><img style=\"vertical-align:middle; margin-right:10px\" src=\"attels2.jpg\"
width=\"61\" height=\"58\" border=\"0\" name=\"ba$mb_id\">$mb_text</a><br /></tr></td>";
}
}
?>
Question
Cibiņš
Kā var panākt lai "case" un "ba" izvelk ID no datubāzes? Ja "case" un "ba" ir 7 tad viss ir ok, savukart ja pie ID ir kads cits skaitlis tad attiecigi izvelk citu ID tas Javaskripts.
javaskripc.js
PHP
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.