Jump to content

iarp

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by iarp

  1. Try putting the $counter++ to just above the "if ($counter..." statement.
  2. That's because $row's value don't change until the next iteration happens in the while () loop. Both of your for statements are executing within the while so $row doesn't change. What you're looking for is a counter that checks if the current iteration of the while loop is divisible by 4 (because you want 4 columns) to then break and start a new row. This is untested but I think this is what you're after. echo '<tr>'; $counter = 0; while($row = mysqli_fetch_assoc($result)) { echo "<td height='160' valign='top' class='featured'>"; echo "<div class='Image-Thumbnail'>"; echo "<a href=''>"; echo "<img src='".$row['image']."' width='160' height='54' alt='".$row['vehicle_name']."'>"; echo "</a>"; echo "</div> <a href=''>" .$row['vehicle_name']. "</a>"; echo "</td>"; if ($counter % 4 === 0) echo '</tr><tr>'; $counter++; } echo '</tr>';
  3. Well you seem to already have the PHP finished, I would recommend having a look at the GNU Parallel documentation to figure out how to get it working.
  4. Are both virtual hosts running as the same user/group or are you modify those with AssignUserId?
  5. This is a job for javascript or jquery. Here is a stackoverflow question/answer with a good example of what you'll want to be looking into with jquery. It's not a solution, but most of what you need is there. You'll just have to figure out a way of storing the order in which the checkbox was clicked. Typically using a counter of some type.
  6. I would echo $thisfile to see what it is trying to delete and see if that path actually exists.
  7. You have not supplied us with anything. We need to see code you've written or are working on. How many sites? How many pages? What are you crawling? What are you doing with the data?
  8. By default PHP stores session data in a file in the session.save_path directory found within your php.ini file. You could configure it to use a database if you wanted. Otherwise it is a regular file. A cookie in the users browser contains a unique value that matches a file within the directory containing whatever their session data contains. The reason it can be so easy to hijack a session is because there is nothing else that links that unique id to your browser aside from the cookie. So if I were to give someone the ID or they took it from my machine somehow, they could override their own browser's cookie value with my session ID and instantly have whatever is in my session data.
  9. What is the uploading chunk size? Does it attempt to upload the entire thing at once or in chunks?
  10. Try a comma followed by a space and then the next email address. "email1@domain.com, email2@domain.com"
  11. Are you wanting to manage these 3 blogs from a single location? I know Joomla could do that for you. Or as scootstah said, are you wanting subdomains/subfolder structure for each different blog?
  12. You most likely cannot see any errors as display_errors = Off within your php.ini Try adding the code below to the top of that script, or whatever script you're getting a blank page on. <?php error_reporting(E_ALL); ini_set("display_errors", 1);
  13. You should have a column on Calendar and another on Stocks, people typically name them id. In MySQL when you create the table you can set ID INT AUTO_INCREMENT which will automatically assign a new integer value to every single row that is unique to that specific row on that table. If you had a one-to-one match you would have a second column on the Calendar table called stocks_id and what that column would contain is the Stocks.ID column value, so when you go to join the tables in the query you say Calendar.stocks_id = Stocks.ID and there is no searching require by MySQL to return that join. Its fast and simple. You say there can be more than one Stocks in a Calendar.SName. In this scenario you would have a third table that stores both the Stocks and Calendar ids that relate to each other. SELECT s.SName, s.Symbol, c.CD, c.FR, c.PCD FROM Calendar c JOIN Calendar_Stocks cs ON cs.calendar_id = c.id JOIN Stocks s ON s.id = cs.stocks_id WHERE s.SName = 'GOOG' This query is untested, I'm going off memory here and I may have the incorrect join required. But that should return all Calendar items that are linked to a Stocks item with a Stocks.SName equaling a specific value rather than you having the LIKE search for that value.
  14. What is in Calendar.SName and Stocks.SName? Is there more than one Stocks.SName in a single Calendar.SName row? Is that why you're having to do the LIKE statement? If that is the case, you would've been better off using a linker table based on the auto_increment id within Calendar and Stocks table. It may not be too bad of an idea to add one now as the LIKE statement is what is most likely causing your timeout.
  15. Do you have any code written for this idea? Can you show us what you have? If you wanted to do this strictly with php/html alone, you would most likely want to use the $_SESSION system or store the selected products in a database table so that you know what they have selected. Every time they click the Add Product button you could have a form that appears and adds another product to the $_SESSION data. There is no real limit on how many products you could add using that idea. The basic workflow of this idea would be something like: Press Add Product button which is actually a link to the Add Product page On the Add Product page you display the dropdown selection and a Submit button in a <form> when that gets clicked you add whatever data was in that form to something like $_SESSION['products'] and then redirect them back to the main page showing all their currently selected products. Back on the currently selected products page, you foreach ($_SESSION['products'] as $products) and echo out whatever information is in there into a table of some type. The other option would be to look into javascript which would allow you not require visiting other pages and redirecting users around.
  16. I would recommend you look into either mysqli or PDO before continuing much farther with the code. Here is a good example of starting with PDO and how to execute queries correctly and in a safe manner. As it currently is, the queries are completely unprotected and someone could easily delete your entire database.
  17. You've made this a lot harder on yourself. It looks like you're trying to format and print json by hand. I would recommend doing something along the lines of: $data_array = array( 'current_time' => '', 'uptime' => '', 'load_averages' => '', 'temperature' => '', 'memory' => array( 'ram' => array( 'total' => '', 'used' => '', 'free' => '', 'mem_percentage' => '', 'units' => 'Gigabytes' ), 'sd_card' => array( 'total' => '', 'used' => '', 'free' => '', 'mem_percentage' => '', 'units' => 'Gigabytes' ), ) ); echo json_encode($data_array); To set the RAM memory total $data_array['memory']['ram']['total'] = $where_ever_ram_total_comes_from;
  18. My suggestion would be to try running the queries manually within MySQL directly and seeing if the output is what you are expecting. None of those LIKE statements look correct to me at all. If anything I would try wrapping the variables you're using within the queries in single quotes, kind of like: $res_marca = $db->query("SELECT id_marca,marca FROM marcas WHERE id_marca LIKE '$mark'"); This also begs the question, are you sure you want LIKE conditions and not regular equals to? LIKE conditions typically also contain percent signs that allow you to search for a specific value that maybe within several other values in a single cell.
  19. I would commentout the header('Location: ..') line until it is sending you an email. As well is display_errors = On in your php.ini file?
  20. file_get_contents needs allow_url_fopen = 1 in your php.ini to allow downloading files from an external source. curl may need to be enabled in your php.ini or you need to post the curl code so we can check it. Is display_errors = On in your php.ini?
  21. The code you posted, is that copy and pasted right from your work or did you modify it for us? It's broken by the looks of it. Maybe it's throwing an error but redirecting to the other page before you see the message. Comment out the header and see what happens.
  22. I see you already have the echo $rfi_fileName; there. Sounds like you just need to build a url that would link the user to wherever you're storing the files. echo '<a href="http://www.mydomain.com/files/' . $rfi_fileName . '">' . $rfi_fileName . '</a>'; Something like that maybe? It all just depends on where you are saving the files and whether or not you need protection on the files.
  23. You don't have matching columns and values. I see two columns that start "uid" and "unique_id" and in your values you go "$uuid" and then "$fname" If uid or unique_id are auto_increments in MySQL, you do not need to include them in the INSERT statement.
×
×
  • 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.