I created a search function. It can get the address from the whole lesson, but how can I create query search from parts of the address? For example, the complete address is Paya lebar Road Blk27 , how can I do this so that the user can simply type in paya and it will still be visible? SearchForm & lt; H2 & gt; See Patient Records & lt; / H2 & gt; & Lt; Body & gt; & Lt; Form action = "display_patient.php" method = "post" & gt; & Lt; P & gt; Choose: & lt; Select name = "patient_war" & gt; & Lt ;? Php $ value = array (see_now, name, address); Forex Currency ($ value $ option) {echo '& lt; Option value = "'. $ Option.' '' (Issued ($ _ POST ['Patient' '']) and $ _POST ['Patient' '] == $ Option?' Selected ':' ''). ' & Gt; ' . $ Option '& lt; / option & gt;';}? & Gt; & lt; / select & gt; & lt; input type = "text" name = "typed" value = "" /> ; & Lt; Input Type = "submit" value = "submit" /> <<> & lt ;? php if (Isset ($ _ POST ['disease_use'])) {$ type = $ _POST ['typed']; select $ $ = $ _POST ['patient' '']; if ($ Select == 'View_all' ) {Resonant "& lt; Table range = '1' & gt; "echo" & lt; Tr & gt; \ N "; echo" & lt; Th> id & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Patient's name & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Age & lt; / Th & gt; \ N "; echo" & lt; Th & gt; NRIC & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Date of birth & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Medical allergy & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Medical History & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Phone & lt; / Th & gt; \ N "; echo" & lt; Th & gt; Address & lt; / Th & gt; \ N "; echo & quot; and & gt; doctor assigned & lt; / th & gt; \ n"; Echo "& lt; / tr & gt;"; $ Pat_set = default_impressions (); While ($ mo = mysqli_fetch_array ($ pat_set)) {echo "<<"; Echo "& lt; td & gt;" . $ Mo ['id'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['name'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['age'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['enric'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['birthday'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['medical_alleries'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['medical_history'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['phone'] "& lt; / td & gt;"; Echo "& lt; td & gt;" $ Mo ['address']. "& Lt; / td>"; Echo "& lt; td & gt;" $ Mo ['doctor_said'] "& lt; / td & gt;"; Echo "& lt; / tr & gt;"; }} Else {echo "and lieutenant table = '1' & gt; \ n"; Echo "& lt; tr & gt; \ n"; Echo "& lt; th> id \ n"; Echo "& lt; th & gt; Patient's name & lt; / th & gt; \ n"; Echo " Age \ n"; Echo "& lt; th & gt; NRIC & lt; / th & gt; \ n"; Echo " gt; date of birth & lt; / th & gt; \ n"; Echo "& lt; th & gt; Medical allergy & lt; / th & gt; \ n"; Echo "& lt; th & gt; Medical History & lt; / th & gt; \ n"; Echo "& lt; th> phone & lt; / th & gt; \ n"; Echo "& lt; th & gt; Address & lt; / th & gt; \ n"; Echo & quot; By & gt; The doctor was assigned & lt; / Th & gt; \ N "; echo" & lt; / Tr & gt; "; $ Patients_set = find_patients ($ choose, $ type); while ($ row = mysqli_fetch_array ($ patient_set)) {echo" "$ line ['name']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['age']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['encryic']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['birthday']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['medical_allergies']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['medical_history']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['phone']" & lt; / TD & gt; "; echo" & lt; Td> "$ line ['address']." & Lt; / Td> "; echo" & lt; Td> "$ line [doctor-specific ']" & lt; / TD & gt; "; echo" & lt; Post-text "itemprop =" text "> To search in MySQL, whether a column specific string is used example SELECT * to the table WHERE Just like it in the column '% somestring%'; Just try it in your case $ typed = $ _POST ['typed']; and do a MySQL query like this $ query = "Select * From the table where address '%". $ Typed. "%'"; < / Code>
Popular posts from this blog
I have a phone unit unit that contains many properties for many unit entity classes I An exception is given during the rendering of a template ("You must define a associated_property option or Create a \ __counter __ \ Examens \ ExamensBundle \ unit \ Grade Proxy :: __ toString service examens.examens.admin.fonctionnaire from the field option idGrade to the method is in SonataDoctrineORMAdminBundle "): CRUD: Line_ on line_list_orm_many_to_one.html.tw Fontionnaire.php class: & lt ;? Php namespace exams \ ExamensBundle \ Entity; Use the theory / ORM \ mapping as an ORM; / ** * PhoneNationLayer * / Class Fictionalair {//...//// ** * @VARAEfimens \ Examinations Bundle \ Unit \ Grade * / Private $ IDGed; //...//} FonctionnaireAdmin.php: & lt ;? Php namespace exams ExamensBundle \ Admin; Use Sonata \ AdminBundle \ Admin \ Admin; Sonata \ AdminBundle \ Datagrid \ ListMapper; Sonata \ AdminBundle \ Datagrid \ DatagridMapper; Sonata \ AdminBundle \ Validat...
I have the following ControlTemplate that is the same for all my custom controls. & amp; the lift; ControlTemplate x: key = "PssFunctionControlBaseHorizontal" TargetType = "Local: PssFunctionControlBase" & gt; & Lt; Grid & gt; & Lt; Threshold Threshold = "1" & gt; & Lt; Content Control X: Name = "Inner Content" Template = "{Static Resources Inner Contentbase Horizontal}" /> & Lt; / Border & gt; & Lt; Control x: name = "PART_ResizeDecorator" visibility = "short" template = "{static resource resize deccurratematet}" /> & Lt; / Grid & gt; & Lt; ControlTemplate.Triggers & gt; & Lt; Data Trigger Value = "True" Binding = "{Binding Editing Moded, Relative Soros = {ResolveSource Search Engineer, Instant Type = {x: Type Local: PssViewLayoutControl}}}" & gt; & Lt; Setter target name = "PART_ResizeDecorator" ...
I have a little code here. Could you please tell me what this code really does? please. Here in the AJAX call: $ .ajax ({url: "{% url} upload_document '%}", type: "POST", data : {Csrfmiddletoken: document.getElementsByName ('csrfmiddletoken') [0] Price, Title: document.getElementById ('title'). Value, // document: document: document.getElementById ('document'),}, datatype: "Jason", success: function (feedback) {if (feedback == "true") {// success} other {// attachment errors}}}); How AJAX works in the Django and how we can see the AJAX request. Here is the idea of my thoughts def upload_document (requested): Print request. POTT print request FILES if request.is_ajax (): If request.method == 'POST': form = UploadForm (request.POST, request.FILES, user = request.user) if form.is_valid (): Form.save () return HTTPPCS (SimpleJason Dumps ('True'), Mime Type = 'App / Jason') Other:...
|
Comments
Post a Comment