Jump to content

morena

New Members
  • Posts

    6
  • Joined

  • Last visited

morena's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a php switch statement and for some reason php switch is only executing the default code in the default block but not in the case block, i check if my variable is isset first, then use switch to select data from my DB, even if i do var_dump($cname); it shows that variable $cname corresponds with my first case, what is the problem here? here is the code $sel = 1; $sql = "(select * from insurance_companies WHERE id='$eop' LIMIT $sel)"; foreach ($pdo->query($sql) as $row){ $cID = $row['id']; $cname = $row['name']; } if (isset($cname)) { switch ($cname) { case 'CASH': $query= "SELECT test FROM cash_procedures WHERE test LIKE '%$did%'"; $result= $con->query($query); break; default: $query= "SELECT test FROM procedures WHERE test LIKE '%$did%'"; $result= $con->query($query); } }
  2. thanks for getting back to me.. as for not closing the form i only took the snipet of the code that actually retrieves the data that im looking for,and even if i narrow the select statement to only select one column it still does the same thing than you will also try that out
  3. good day, i have an application which i have developed in php and MySQL but when i populate the database with lots of data(data required by the application) it makes the browser unresponsive and takes longer to execute, can anyone please help me resolve this. I include the code below. <?php include_once 'dbConfig.php'; $query="SELECT * FROM medications"; $result= $con->query($query); ?> <select id="nol" style="width: 40%;" name="disease" required="true" data-toggle="tooltip" data-original-title="medications" class="date-picker form-control col-md-7 col-xs-12" data-rel="chosen"> <option value="">Select Disease</option> <?php while ($row=$result->fetch_array(MYSQLI_ASSOC)) { ?> <option value="<?php echo $row['ICD10']?>"><?php echo $row['diagnosis'];?> </option> <?php } ?> </select> <form method="POST" action="generate-invoive-results-service.php"> <input type="hidden" name="id" value="<?php echo $id;?>"> <?php $query="SELECT * FROM medications"; $result= $con->query($query); ?> <select id="nol" style="width: 30%; ;" name="prescription" required="true" data-toggle="tooltip" data-original-title="medications" class="date-picker form-control col-md-7 col-xs-12" data-rel="chosen"> <option value="">Select Medicatioon</option> <?php while ($row=$result->fetch_array(MYSQLI_ASSOC)) { ?> <option value="<?php echo $row['prescription']?>"><?php echo $row['prescription'];?> </option> <?php } ?> </select>
  4. @ benanamen thank you, thats what i am actually looking for, i will check it out @Barand thank you for your sugesstion too.
  5. good day, i have a programme built in php and html which i want to incorporate a searcheble dropdown menu in it,i found this link on how to do it using jquery http://jsearchdropdown.sourceforge.net/ but the problem is that one used option tags around all of thier options, which is something i can not do because my dropdown will hold around 70000 options. here is my php code: <?php include_once 'dbConfig.php'; $query="SELECT * FROM medications"; $result= $con->query($query); ?> <select id="nol" style="width: 40%;" name="disease" required="true" data-toggle="tooltip" data-original-title="medications" class="date-picker form-control col-md-7 col-xs-12" data-rel="chosen"> <option value="">Select Disease</option> <?php while ($row=$result->fetch_array(MYSQLI_ASSOC)) { ?> <option value="<?php echo $row['ICD10']?>"><?php echo $row['diagnosis'];?> </option> <?php } ?> </select> so what i need help with to be make that dropdown have a search feature or function but do not know how to doit, also because the data in the dropdown is being populated from the database not hard coded in html as options
×
×
  • 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.