Jump to content

ansarka

Members
  • Posts

    128
  • Joined

  • Last visited

    Never

Everything posted by ansarka

  1. change your code to print the sql check weather the sql is correct or not copy the sql and try it directly in mysql $sql ="select sum(Wealth) as sumofwealth from provinces where Owner ='$taxuser' group by Owner"; echo "$sql"; $query=mysql_query($sql); $result =mysql_fetch_array($query); $amount =$result[sumofwealth];
  2. r u sure you have value in $taxuser
  3. check this code $qry = "SELECT level as level FROM accesslevel WHERE position= '$position' "; $result=mysql_query($qry); $result = mysql_fetch_array($result); $level = $result[0]; $qry = "UPDATE members SET level = '$level' WHERE teacherid = '$teacherid' "; $result = mysql_query($qry); $qry2 = "UPDATE teacher SET position = '$position' WHERE teacherid = '$teacherid' "; $result2 = mysql_query($qry2); //Check whether the queries was successful or not if($result && $result2) { header("location: updatesuccessful.php"); exit(); }else { die("Query failed"); } mysql_close();
  4. change the query to $receiptresult = mysql_query ("SELECT SUM(Wealth) FROM provinces WHERE Owner = '$taxuser'");
  5. Another method <?php $num = 4; $zerofill = 3; echo str_pad($num, $zerofill, "0", STR_PAD_LEFT); /* Returns the same wanted result of '004' */ ?>
  6. Check below code ;) ;) <?php for($i = 0; $i < 200; $i++) { $pr_id = sprintf("%03d", $i); print "<span style='color: #cc0000; >$pr_id</span> <br>"; } ?>
  7. ansarka

    mkdir?

    you may not have permission to create the folders chk the permission of folder httpdocs and clients
  8. :o :o :o :o ;) ;)Look below code <?php $res="select * from table"; $res=mysql_query($res); $data=""; $data .="<tr><td><table><tr>"; while($row=mysql_fetch_array($res)) { $data .="<td>". $row['id']." </td>"; $data .="<td>". $row['name']." </td>"; $data .="<td>". $row['phone']." </td>"; if($i%3 ==0) { $data .="</tr><tr>"; } } $data .="</table></td></tr>"; echo $data; ?>
  9. i dont say you have to hard code the sub category fields on loading the page you have to take it from sub category table and will have to dynamically create a javascritp array : :
  10. Hope this will help you ;) ;) <?php $data=""; $data .="<tr><td><table><tr>"; for($i=1;$i<=10;$i++) { $data .="<td> $i </td>"; if($i%3 ==0) { $data .="</tr><tr>"; } } $data .="</table></td></tr>"; echo $data; ?>
  11. You can do this without using AJAX ;) ;) There are two ways 1. Using form reload In this method on change of the combobox will have to reload using the combobox value and fill the sub combo > Not so good method 2. Using javascript When you load the page you have to store all the subcategories in a javascript two dimensional array and on change of the main combobox you have to fill the sub combobox values by filtering the array of sub categories one doubt ??? ??? :o :o if you can allow the request you cannt you use ajax ??? ??? ???
  12. Is that working :) :) Always here to help according to my and GOOGLES ;) ;) Knowledge
  13. plz echo $updateSQL what the query its printing copy that query and run it in mysql without any php code (using phpmyadmin or any other tools)
  14. check anywhere in your code whether you are running mysql_query($updateSQL, $conn) two times ;)
  15. after submit change $_SESSION['id'] = 1; :) :) : :
  16. one of the certification is zend certification
  17. simple html to invlode outlook <a href="mailto:name@domain.com,john@doe.com?cc=sales@here.com& bcc=admin@there.com&subject=Complaint& body=Dear sir.%0AI have a complaint to make">Mail us!</a>
  18. in template.php add ob_start(); in line number one <?php ob_start(); setcookie ("styleCookie", $style, time()+40000000); ?> ;) ;)
  19. increase the width of image change below code $img = imagecreate(200, 50); TO $img = imagecreate(200, 100); ;) ;) ;)
  20. :) <? $mysqli = new mysqli('host','username','password'); $mysqli->select_db('orders'); $result = $mysqli->query("SELECT * FROM quotes"); echo "<SELECT name='quoteid'>\n"; echo "<option value=''>Select</option>\n"; while($row = $result->fetch_assoc()) { echo "<option value='{$row['quoteid']}'>{$row['quoteid']}</option>\n"; } echo "</select>\n"; $result->close(); ?>
  21. change this code to /** * Generate a 5 char random code */ function _gen_rand(){ $code = ''; for($i=0;$i<5;$i++){ $code .= chr(rand(65, 90)); } return $code; } change the to any number you want to have
  22. you have given same name for submit button and text area also make sure that you hv write permission to file below code is working try it <?php if($_POST['addition']){ $file_open = fopen("something.txt","w+"); //fopen("something.txt","a+"); to add the contents to file fwrite($file_open, $_POST['addition']); fclose($file_open); } ?> <form action="<?=$PHP_SELF?>" method="POST"> <textarea name="addition" COLS=40 ROWS=6> <?php $datalines = file ("something.txt"); foreach ($datalines as $zz) { echo $zz; } ?> </textarea> <input type="submit" name="button"> </form> ;) ;)
  23. Please go through below links May be it will helps you http://webpages.dcu.ie/~tuited/php_primer/tut_xml_edit.htm http://www.activewidgets.com/javascript.forum.6613.0/trying-to-use-xml-php.html http://www.ister.org/code/xml22/
  24. you are assigning $pic twice and you are not assigning value for photo New code try this <?php //This is the directory where images will be saved $ran = rand () ; $ran2 = $ran."."; $target = "images/"; $target = $target .$ran2. basename( $_FILES['photo']['name']); $ok=1; //This gets all the other information from the form $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $photo=$ran2.($_FILES['photo']['name']); $pic= $_POST['photo']; // Connects to your Database mysql_connect("localhost", "###", "###") or die(mysql_error()) ; mysql_select_db("root") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO `table` (`name`, `email`,`phone`,`photo`) VALUES ('$name', '$email', '$phone', '$photo')") ; $id= mysql_insert_id(); //This is our size condition if ($uploaded_size > 35000) { echo "Your file is too large.<br>"; $ok=0; } //This is our limit file type condition if ($uploaded_type =="text/php") { echo "No PHP files<br>"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory"; echo " Your Registration Form Number is . $id ";} else { //Gives and error if its not echo "Sorry, there was a problem uploading your file.";} $query = "SELECT * FROM table WHERE id=$id"; $result = mysql_query($query)or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "<p>FORM NUMBER :62RRI/ <b>".$id."</b><br><br>"; echo "<img src=http://localhost/army/$target".$row['photo']."> <br>"; echo "<p>Name: <b>".$row['name']."</b><br>"; echo "<p>E-Mail: <b>".$row['email']."</b><br>"; echo "<p>Phone Number: <b>".$row['phone']."</b><p>"; echo "<p>Your Photo: <b>".$row['photo']."</b><p>"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.