Jump to content

abrahamgarcia27

Members
  • Posts

    131
  • Joined

  • Last visited

Posts posted by abrahamgarcia27

  1. Hey:

     

    I currently have an ubuntu virtual machine running my apache2 server. This server contains phpmyadmin and it was working fine 2 days ago. When i access phpmyadmin within the virtual computer like http://localhost/phpmyadmin i can login fine but when i access it through the mac computer that runs the virtual computer like http://172.16.130.131/phpmyadmin it just gives me a link like this http://172.16.130.131/phpmyadmin/index.php?lang=en&collation_connection=utf8_general_ci&token=b5f088520428a0cb147f5e28733d8475.

     

    I don't know if anyone has encountered this problem before.

     

     

  2. This is the following Structure of the problem i am dealing with

     

    Page bands.php -> Queries all the Results of Bands and ORDER BY band_name ASC WHERE STATUS = 1

     

    Once Band is Clicked it goes to -> viewband.php WHERE band_id information is displayed

     

    Once in viewband.php -> i have a two buttons one for next band and one for previous band

     

    The question is how do i structure the query i dont want to display the next bigger id. Rather i want to display the next band WHERE that band_name is next AND WHERE STATUS = 1

     

    Does any one have an idea on how i can structure this query?

     

     

  3. well i think you have a page where it displays all the products which they have a link to the product_name=item-name correct ?

     

    so before we do this we will change all the products link to this

    <?php
    $word = $row['itemname']; 
    $word2 = str_replace( ' ', '-', $word ); 
    ?>
    <a href="?id=<?php echo $word2; ?>">See Product</a><br />
    
    
    
    <?php
    //this is the other page
    $string = $_GET[itemname];
    $string2 = str_replace( '-', ' ', $string ); 
    
    echo $string2;
    //use string two to query your data
    
    "SELECT * FROM Table WHERE name = {$string2}"
    
    ?>
    

  4. i think this is what your looking for, but i dont know anything about what percentage you want. What this percentage is telling yo is that the rent is 22% percent of the total purchase price. I am not sure if this is what you are looking for

    <?php
    
    $purchase = 44000;
    $rent = 9860;
    
    $percent = round($rent / $purchase * 100, 2); //this is wrong, it returns 4.3 but should be over 18
    
    echo "Percentage is {$percent}%";
    
    ?>
    

  5. yeah sorry for that is from one of my past code that i done. The Option Value is what your are actually posting in my case is the class_id and the other is what it is actually displaying in the drop down class_title. So just replace that with your table information.

  6. Try this

     

    <?php
    $word="this is the spaced word"; 
    $word2 = str_replace( ' ', '-', $word ); 
    echo $word; echo "<br />";
    echo $word2;echo "<br />";
    ?>
    <a href="?id=<?php echo $word2; ?>">click</a><br />
    
    <?php
    
    
    $string = $_GET[id];
    $string2 = str_replace( '-', ' ', $string ); 
    
    echo $string2;
    //use string two to query your data
    
    
    ?>
    

  7. i would put all the select names i think they are cities into a table and query all of them to make your code shorter and cleaner.

    <?
    session_start();
    $_SESSION['oldID'] = $_POST['oldID'];
    $_SESSION['animalID'] = $_POST['animalID'];
    $_SESSION['status'] = $_POST['status'];
    $_SESSION['date'] = $_POST['date'];
    $_SESSION['species'] = $_POST['species'];
    $_SESSION['breed'] = $_POST['breed'];
    $_SESSION['sex'] = $_POST['sex'];
    $_SESSION['primary_colour'] = $_POST['primary_colour'];;
    $_SESSION['colour'] = $_POST['colour'];
    $_SESSION['distinctive_traits'] = $_POST['distinctive_traits'];
    $_SESSION['fur_length'] = $_POST['fur_length'];
    $_SESSION['age'] = $_POST['age'];
    $_SESSION['desexed'] = $_POST['desexed'];
    $_SESSION['microchipped'] = $_POST['microchipped'];
    $_SESSION['suburb'] = $_POST['suburb'];
    $_SESSION['pound_area'] = $_POST['pound_area'];
    $_SESSION['contact'] = $_POST['contact'];
    $_SESSION['link'] = $_POST['link'];
    $_SESSION['notes'] = $_POST['notes'];
    $_SESSION['uploaded_file'] = $_FILES['uploaded_file'];
    $_SESSION['imageFile'] = $_FILES['uploaded_file']['name'];
    $_SESSION['imageMime'] = $_FILES['uploaded_file']['type'];
    $_SESSION['imgData'] = $_FILES['uploaded_file']['tmp_name'];
    $_SESSION['imgSize'] = $_FILES['uploaded_file']['size'];
    
    //If the photo field is empty, we call the no photo stuff
    if($_SESSION['imgSize'] === 0){
    header("Location: nophoto.php");
    }else{
    header("Location: Photo.php");
    }
    ?>
    

     

  8. Is this what you are looking for?

     

    <?php
    // Make a MySQL Connection
    mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
    mysql_select_db("test") or die(mysql_error());
    
    // Get all the data from the "example" table
    $result = mysql_query("SELECT * FROM example") 
    or die(mysql_error());  
    ?>
    <select name="" >
                           <?php while($record = mysql_fetch_array( $result )) {  ?>
      						  <option value="<?php echo $record[class_id];?>"><?php echo $record['class_title']; ?> </option>
                           <?php } ?>
                                
                            </select>
    
    
    
    

  9. it didnt work, but it sure helped me out this is the code that i used

     

     

       <?php 
    
    echo "<ul class='services-list'>";
    
    $i = 1;
    foreach ($rows_class as $record_class ){
    
    
    
    if($record_class === end($rows_class) ) {
    echo "<li class='bubble last'>\n";
    }
    else if($i <= 2) {
    echo "<li class='bubble'>";
    }
    
    $string = $record_class['description']; 
    ?>
    <a href="viewclass.php?class_id=<?php echo base64_encode($record_class[class_id]) ?>">
    <h6 class="title"><img src="./images/services/picture-services.png" 
    class="picture" alt="logo" />
    <?php echo $record_class[class_title]; ?>
    </h6></a>
    <p>
    <?php  
    echo substr(strip_tags($string), 0, 200); 
    ?>
    </p>
    </li>
    <?php
       $i++;
    }
                        
    
    ?> 
          </ul> 
    
    

  10. I am have a query with a limit of 3 i want it to echo the first two in one li class and the 3 in another li class. This is what i have, but i know the logic is not right, but i cant figure it out

     

                </div>
    <?php 
    
    echo "<ul class='services-list'>";
    //echo "<li class='bubble'>";
    $i = 1;
    foreach ($rows_class as $record_class ){
    ?>
    <li class="bubble"><a href="viewclass.php?class_id=<?php echo base64_encode($record_class[class_id]) ?>" /><h6 class="title"><img src="./images/services/picture-services.png" class="picture" alt="logo" /><? echo $record_class[class_title]; ?></h6></a><p><?php $string = $record_class['description'];  echo substr(strip_tags($string), 0, 200); ?></p>
                    
                    
                    
    <?php if( $i % 2 === 0 && $record_class !== end($rows_class) ) {
    echo "</li>\n<li class='bubble last'>\n";?>
    
    
    <?php
      } elseif ( $record_class === end($rows_class) ) {
          echo "</li>\n ";
       }
       $i++;
    }
                        
    
      ?> 
          </ul>  
    
    

  11. is probably because i have a mess in my code. :( Well maybe you can spot something or maybe i am doing it wrong

    i have two tables one order and order_details

    so i need to get a record from the order table and then bring that record  back to order_details

    so this is how it works

    Search Bill Of Lading -> (go to order table) Get Order ID -> (go to order details table) -> Get all records for that order

    so i did this

     

    $searchlading = mysql_real_escape_string($_GET['searchlading']) ; // get the query for the search engine (if applicable)
    $trimmed = trim($searchlading); //trim whitespace from the stored variable
    //query for pedimento
    $sql_ped = "SELECT order_id, bill_of_lading, pedimento_num FROM `".TABLE_ORDERS."` WHERE bill_of_lading LIKE '%$trimmed%'";
    $record_ped = $db->query_first($sql_ped);
    
    //query for item details
    $sql_order = "SELECT order_details_id, order_id, product_id, po_num, warehouse_num, vendor_id FROM `".TABLE_ORDERDETAILS."` WHERE order_id = $record_ped[order_id] ORDER BY order_details_id DESC LIMIT 150";
    $rows_order = $db->fetch_all_array($sql_order);
    ?>
    
    
    

     

     

  12. I am trying to perform a search but it doesn't see to pass through i thing its because of this \ does any one know how i can pass this trought to search in mysql table

     

     

    12\019PB (i cant search this item)

     

    $searchlading = mysql_real_escape_string($_GET['searchlading']) ; // get the query for the search engine (if applicable)
    $trimmed = trim($searchlading); //trim whitespace from the stored variable
    //query for pedimento
    $sql_ped = "SELECT order_id, bill_of_lading, pedimento_num FROM `".TABLE_ORDERS."` WHERE bill_of_lading LIKE '%$trimmed%'";
    

  13. I have a store number that i want to add and echo. This resembles an invoice so i my table has unit_price and total_value which is defined by by multiplying unit_price and pieces. Now that i want to print invoice i want to know how to add all items that are from that invoice_id

     

    //get the total value for order
    $sql_value = "SELECT total_value FROM `".TABLE_ORDERDETAILS."`WHERE order_id = $record_order[order_id]";
    $rows_value = $db->fetch_all_array($sql_value);
    foreach($rows_value as $record_value){
    $value = $record_value[total_value];
    
    }
    

     

  14. i am trying to use mpdf and i am trying to pass a for each loop. i was thinking equaling to a variable, but i saw you cant do that.

    foreach($rows_details as $record_details){
            echo "<td>$record_details[po_num]</td>
          <td>$record_details[warehouse_num]</td>
    	  <td>$record_details[quantity]</td>
    	  <td>$record_details[packages]</td>
    	  <td>$record_details[weight]</td>
    	  <td>$record_details[product_id]</td>
    	  <td>$record_details[pieces]</td>
    	  <td>$record_details[unit_price]</td>
    	  <td>$record_details[total_value]</td>";
    }
    

     

    so i have to pass it through this any one have an idea

    
    $html = '
    <tr>
    
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td> 
    
    
    </tr>
    
    $mpdf->WriteHTML($html);
    
    $mpdf->Output(); exit;
    
    exit;
    
    

×
×
  • 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.