Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. I'm a bit confused by your code, check if this is correct: $sql_skillarray = "SELECT * FROM skill_sellers WHERE id = '".$_REQUEST['id']."'"; $result_skillarray = mysql_query($sql_skillarray); while ($rs_skill = mysql_fetch_array($result_skillarray)) { print "<option value=\"".$rs_skill["id"]."\"".(isset($_POST['skill']) && in_array($rs_skill['id'], $_POST['skill']) ? ' selected="selected"' : '').">".ucwords($rs_skill["skill"])."</option>"; }
  2. Like I thought $_POST['skill'] does not contain anything Post your entire script again.
  3. while($data = mysql_fetch_assoc($result)) { $user12=$row['username']; $masspm=mysql_query("INSERT INTO messages VALUES(NULL, 'Virtual-soccer', '$user12', '$sub12', '$mess12', '0')"); } Not true it inserted atleast one row unless the query failed.
  4. $myFile = "NieuwGastenboek.txt"; You are reading from a different file then you are outputting to: $uitvoerbestand = "gastenboek.txt"; PS: Belg of Nederlander?
  5. http://mediumexposure.com/techblog/smart-image-resizing-while-preserving-transparency-php-and-gd-library Pass 'return' as $output it will return the resized image as an gd image object. Or use this script: http://www.vipercreations.com/tutorials/PHP/22/
  6. You may also want to check your operating system and the maximum filesize it can handle as you may find yourself one day not adding any data while on the other end still data is being added. The same goes for your total disk space available. Windows: http://technet.microsoft.com/en-us/library/dd316417.aspx Linux: http://doh.vorax.org/docs/suse91/apas04.html
  7. Use CRON to automate the download. To increase performance which I seriously recommend with such size can be found at http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html I also strongly advice to use some other method then just download and afterwards 'load date infile' as everytime the CSV gets updated you need to download the whole 1.6 GB again and it's size will only increase and what about the rows you have already in your database when you re-download the whole 1.6 GB? If for example only 500 lines were added instead store the position of your pointer in the big file and next time you need to download read from the position of your pointer to the end of the line, store those lines in a local file and use that as your next 'load data infile'
  8. myusername is nothing probably some code from some tutorial where it made sense. And like thorpe said it's deprecated use: session_start(); if (!isset($_SESSION['myusername'])) { $_SESSION['myusername'] = $username; } Edit: deprecated means it is no longer supported and will be removed in a future version. Wikipedia puts it in this way:
  9. Oh I thought they had been hacked and they added malicious code.
  10. Paste your output here I'll check it with the code you provided.
  11. What do you mean by the valign=middle part shows? Your image is vertically centered?
  12. If you have phpMyAdmin then do an export of the tables of your database(s)
  13. 1. connect to your server 2. open the file in which the redirect happens 3. browse through the source code and look for any code that you did not write 4. if you find nothing then look in the directory for any unknown files (like .htaccess) 5. repeat steps 2-4 for all files and directories until you find any unknown code/file
  14. No this comes in your table defintion: Assume this is one of your tables in your database: CREATE TABLE users ( users_id INTEGER NOT NULL AUTO_INCREMENT, # table defintion .. PRIMARY KEY (users_id) ); CREATE TABLE threads ( threads_id INTEGER NOT NULL AUTO_INCREMENT, threads_starter INTEGER REFERENCES users (users_id) ON UPDATE CASCADE ON DELETE CASCADE, KEY fk_threads_starter (threads_starter), PRIMARY KEY (threads_id) );
  15. SELECT authuser.firstname, bid.addons, signuphotel.hotelname,signuphotel.email,signuphotel.telephone, signuphotel.county FROM bid JOIN signuphotel ON bid.username = signuphotel.username JOIN authuser ON bid.username = authuser.username WHERE bid.proposalid ='$propid' I removed the LEFT I really doubt you want that functionality. If you would remove an entry from signuphotel for which their is an entry in bid you would still get the bid but you would have no hotel for it to display with it.
  16. Have you tried executing your query in phpMyAdmin or any other db interface?
  17. PHP and MySQL are known to be able to handle a serious amount of users regardless of the written code. Like a sponge it's possible to squeeze a few more drops with sufficient added force. So may a well written script serve more users then a bad written script and a well written script that is also optimized may serve even a few more users. Don't worry too much though in the first year your client is only building his customer base. In the second year however your client has an existing customer base and prospects by which the server load will increase and you may want to start looking at buying an additional server, clustering and optimizing your script for use on multiple servers. In the first step you may even want to put your database on a separate server so your current server only handles PHP. And when buying additional hardware make sure the server on which PHP runs has a high CPU power and medium memory and your database server has lots of memory.
  18. http://blog.rvdavid.net/php-httprequest-class/
  19. If Uname ain't an indexed key then you'd be better off using the id (primary key) instead as this will greatly speed up search. page1.php <a href="page2.php?id=$id">view info</a> page2.php print abs((int) $_GET['id']));
  20. When I said: I meant: if ($result = mysql_query($sql)) { while ($row = mysql_fetch_assoc($result)) { Copy and paste your query and paste it in phpMyAdmin a join takes one table not multiple
  21. Not entirely sure but this could work to: field TYPE REFERENCES database.table (field) ON UPDATE CASCADE ON DELETE CASCADE
  22. $subject = $_POST['subject']; $content = $_POST['content']; $template = $_POST['template']; while ($row = mysql_fetch_array ($result)){ $first_name=$row['first_name']; $last_name=$row['last_name']; $emailto = $row['email']; $header = "From: ..\r\nReply-To: ..\r\n"; if (!is_template($template)) {//load default $msg = "Dear $first_name $last_name,\n\n$content"; } else { $header .= "Content-Type: text/html"; $msg = load_template($template, $first_name, $last_name, $subject, $content); } if (!mail($emailto, $subject, $msg, $header)) { //mail was not send } } // verifies $template is indeed a template function is_template($template) { .. } // loads and returns the content of $template function load_template() { $args = func_get_args(); $template = array_shift($args); list($firstname, $lastname, $subject, $content) = $args; //.. }
  23. You don't need 5 different loops just make sure the type is included into the query then you can add this little trick: $type = null;//start empty while ($row = mysql_fetch_assoc($result)) { if ($type !== $row['type']) {//here we compare the type of the current row with the one currently stored echo '<h2>', $row['type'], '</h2>'; $type = $row['type']; } echo '..'; } In order for this to work you need to sort on type something like: ORDER BY type This will make sure all type's of the same are grouped together so instead of: seo wordpress seo wordpress you'll get: seo seo wordpress wordpress Everytime the type changes thus from null to 'seo' and from 'seo' to 'wordpress' it'll output a h2 header once giving you: <h2>seo</h2> ..seo type rows.. <h2>wordpress</h2> ..wordpress type rows..
×
×
  • 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.