Hi all ; please help me what is the expected problem in this code ??! function SearchGrid($query,$updateOk=FALSE,$DeleteOk=FALSE) { $tbl.="<script> var prev=1; function HighLightRow(rowno){ if (rowno%2==0) tblsearch.rows[prev].bgcolor='#66FF99'; else tblsearch.rows[prev].bgcolor='#CCCC99'; tblsearch.rows[rowno].bgcolor='white'; prev=rowno; } </script> "; $result=mysql_query($query); $tbl.="<table id=tblsearch align =center border=0 > <tr bgcolor=gray>"; $RowNum =mysql_num_fields($result); //name of field :) .... for($col=0;$col<$RowNum;$col++) $tbl.='\n <th font color=white>'. mysql_field_name($result, $col).'</font></th>'; //update/delete OK $tbl.='\n </tr>'; $rownow=1; while ($row =mysql_fetch_row($result)) { //fetch_row $tbl.'<tr onmousemove=\"HighLightRow($rownow)\" bgcolor=#eehh99'; if ($rownow%2==0) $tbl.="#669999>"; else $tbl.="#66CC99>"; $rownow++; for($col=0;$col<$RowNum;$col++) $tbl.='\n <td> $row[$col] </td>'; $tbl.='</tr>'; }//while if(mysql_errno()==0) return $tbl.'</table>'; else return "error".mysql_error(); }//function ![8f1682468bfa75dc21deca0505ce11f7](/attachments/large/4/8f1682468bfa75dc21deca0505ce11f7.jpg "8f1682468bfa75dc21deca0505ce11f7")

Member Avatar
Member Avatar
+0 forum 8

s their an error in this code ?? !! it display Image uploded successfully but it isn't !!!!!!! if(isset($_POST['submit'])) { $query="insert into POST (Title,SubTitle,PostDetail,PDay,PMonth,PYear) values('$_POST[_title]','$_POST[_subtitle]','$_POST[_detail]',". date("d").",".date("m").",".date("y").")"; //echo $query; mysql_query($query); $msg="post added sucsessfully"; if($_FILES['_postimage']['tmp_name']!= "") { move_uploaded_file($_FILES['_postimage']['tmp_name'] ,$_SERVER['DOCUMENT_ROOT'].'/Aseelblog/POST_imgs/a.jpg'); $msg.="</br>Image uploded successfully"; //DOCUMENT_ROOT=/var/www/example ///// } else { $msg.="image File too large or no image file "; } **What's the expected problem here ??????**

Member Avatar
Member Avatar
+0 forum 1

Suppose I have a tow SQL tables: Fathers id | name ------------- 1 | Clinton 2 | Gates 3 | Bush 4 | Clinton Sons id | fatherid | name --------------------- 1 | 1 | bill 2 | 1 | suzy 3 | 2 | mera 4 | 2 | suzy 5 | 3 | bill 6 | 3 | rose 7 | 4 | bill ** I would like to write a query that returns the Fathers who have (at least two sons) one of sons named bill and the other son is not suzy . How do I …

Member Avatar
Member Avatar
+0 forum 4

Salam all :) anyone can help me to understand this query in venn diagram SELECT e.id, e.name FROM emp e INNER JOIN deptid D_X ON e.empid = d_x.empid AND deptid = 'X' LEFT JOIN deptid D_Y ON e.empid = d_Y.empid AND deptid = 'Y' WHERE d_Y.empid IS NULL

Member Avatar
Member Avatar
+0 forum 1

Hi all , i have 2 tables first one called emp have 2 columns id and name second one called dep have id and empid and nameOfDep if i want to list all emp that have X dep (But they don't have) Y dep how i can make it ? i think i should using JOIN or more one but i can't make the correct query :(

Member Avatar
Member Avatar
+0 forum 4

Hi all why this code doesn't work correctly but php validate without js work correctly and js without php validate work correctly ?! form.php <html> <head> <title>Registration Form</title> <script language="JavaScript" type="text/javascript"> Function validate () { var str=true; document.getElementById("name").innerHTML=""; document.getElementById("username").innerHTML=""; document.getElementById("pass1").innerHTML=""; document.getElementById("pass2").innerHTML=""; document.getElementById("email1").innerHTML=""; document.getElementById("web").innerHTML=""; if(document.frm.nameTxt.value=='') { document.getElementById("name").innerHTML="Please Enter your name"; str=false; } /////////////// if(document.frm.username.value=='') { document.getElementById("username").innerHTML="Please Enter a Username"; str=false; } ////// ///////////////////////////////////////////////// if(document.frm.passTxt.value=='') { document.getElementById("pass1").innerHTML="Please Enter Password"; str=false; } if(document.frm.password.value!=document.frm.passConTxt.value) { document.getElementById("pass2").innerHTML="Password and Confirm Password does not match"; str=false; } //////////////////////////////////// var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; if(!document.frm.email.value.match(validate_char)) { document.getElementById("email1").innerHTML="Please Enter Valid Email ID"; str=false; } //website var validate_char=/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i; if(!document.frm.website.value.match(validate_char)) { document.getElementById("web").innerHTML="Please Enter …

Member Avatar
Member Avatar
+0 forum 6

Hi all , I am a new in PHP my code don't save information in db and password confirmation code doesn't work correctly this is my simple code : <?php // decleration for varible $name=$_POST['nameTxt']; $username=$_POST['userNameTxt']; $passTxt=$_POST['passTxt']; $passConTxt=$_POST['passConTxt'] ; $email=$_POST['email']; $website=$_POST['website']; $errors=0; $submit=$_POST['btn_done']; // connection to mysql $con=mysqli_connect('localhost','root','root'); if(!$con){ die('Could not connection '.mysqli_error()); } //if $con //select DB : $db=mysqli_select_db('reg') or die (mysqli_error()); // ..... if($submit){ if(!isset($name) || trim($name) == ''){ ++$errors; echo"Please enter the name <br>"; }//if name // username if blank : if(!isset($username) || trim($username) == ''){ ++$errors; echo'Please enter the username <br>'; }//if username // email if …

Member Avatar
Member Avatar
+0 forum 5

The End.