Jump to content

vishalonne

Members
  • Posts

    40
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

vishalonne's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can I make a function of this and call that function where I want search operation.
  2. Hello I have databse in MySQL with 21 fields which are listed below Field Name Data Type NULL status text No roll_no text No branch_id int(5) No student_name text No father_name text No phone1 text No phone2 text No email text No dob date No city text No course_id varchar(5) No class_id int(2) No program text No duration text No comment text No admission_year int(4) No admission_date text No entryby text No address text No admission_no int(4) No fees int(6) No Now I am stuck with search process, I bit confused, how can I perform search for different types of conditions/criteria Few Examples of combinations of condtions 1. Only those records of city=3 2. Only those branch_id=2 3. Only those admission_year='2013' 4. Only those course_id='15' 5. Only those branch_id='2' AND course_id='15' 6. Only those branch_id='2' AND course_id='15' AND city LIKE 'XYZ' 7. Only those admission_year='2012' AND course_id='10' AND duration BETWEEN(2 AND 3) 8. Only those branch_id=2 AND course_id='15' AND student_name LIKE 'XYZ' 8. Only those course_id=7 AND class_id=2 AND father_name LIKE 'XYZ' My search.php form page is designed, I attached the image of form design here but I am confused how can I implement this search options for different situations. Or can view the page here Please give me some guidance and show me the correct way to solve this issue.
  3. Thank you for your co operation After using the code you gave If I select image it it shows "File Uploaded" with the name of the image file And if I don't select image file it show Error: 4 Can't understand why 4? why not it shows "Please select a file"
  4. I just want to save the image of an item in mysql database
  5. As you suggested me to change if(!isset($_FILES[$image])) TO if(!isset($_FILES["IMAGE"])) now if submit the form without selecting any image file it is showing File Uploaded
  6. CAn I just check the this by this way if(!isset($image))
  7. YES YES ITS DONE Thank you Very much NOTICE GONE BUT I am getting Please select a File message and The name of the File Here is the modified code - $code=$_POST['ICODE']; $descp=$_POST['DESCR']; $rate=$_POST['RATE']; $image=$_FILES["IMAGE"]["name"]; if(!isset($_FILES[$image])) { echo '<p>Please select a file</p>'; echo $image; } else { echo "File Uploaded"; echo $image; ......
  8. Now it more problematic If I don't select any image then also it is showing File Uploaded
  9. Now I change my code to like this -> if(!isset($_FILES["IMAGE"])) { echo '<p>Please select a file</p>'; echo $image; } else { echo "File Uploaded"; It is now working showing File Uploaded but notice is still coming Notice: Undefined index: IMAGE in C:\xampp\htdocs\billing\prodinsert.php on line 11
  10. Thank you for Guiding me What is the 2nd paprameter ["name"]
  11. Hi I just wan to to pass the value of Input Type File html tag to a 2nd PHP page where I will insert the image in mysql but I am always getting a notice and isset() is not getting the $_FILE('IMAGE'). Here is the notice - Notice: Undefined index: IMAGE in C:\xampp\htdocs\billing\prodinsert.php on line 11 This is my HTML TAGS - <body> <hr /> <form id="form1" name="form1" method="post" action="prodinsert.php" enctype="multipart/form-data"> <input name="ICODE" type="text" size="10" maxlength="6" /> <input name="DESCR" type="text" size="50" maxlength="45" /> <input name="RATE" type="text" size="10" maxlength="9" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> <input name="IMAGE" type="file" /> </form> And this is my PHP code- <?php $host="localhost"; $user="root"; $pass=""; $db="bill"; mysql_connect($host, $user, $pass) OR DIE (mysql_error()); mysql_select_db ($db) OR DIE ("Unable to select db".mysql_error()); $code=$_POST['ICODE']; $descp=$_POST['DESCR']; $rate=$_POST['RATE']; $image=$_POST['IMAGE']; if(!isset($_FILES[$image])) { echo '<p>Please select a file</p>'; echo $image; } else { echo "File Uploaded"; echo $image; } Where I am making mistake ??? Please guide me.
  12. Thanx for guidence but I'm confused now how to fetch the value from array here I am modifying my code - if($stmt = $mysqli -> prepare("SELECT * FROM $tbl_name1 WHERE confirm_code=?")) { $stmt -> bind_param("s", $passkey); $stmt -> execute(); $stmt->store_result(); $count=$stmt->num_rows; echo "\n".$count; // getting the value 1 which is correct if($count==1) { $rows = $stmt->get_result(); $res=$rows->num_rows; $rows->data_seek($res); [b]// I am not getting link from here HOW CAN I get the value $rows->fetch_assoc());[/b] $v_fname=$rows['temp_first_name']; $v_lname=$rows['temp_last_name']; $v_sex=$rows['temp_sex']; $v_phone=$rows['temp_phone'];
  13. @Barand Yes I agree with you. Am I not implementing this function properly, I suppose I am doing some wrong pocedure to implemet it
×
×
  • 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.