Jump to content

jworisek

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Everything posted by jworisek

  1. try something like this: [code] $string="aslj234u0jlkj3l4k+-043%"; $replace = preg_replace('/[\d]*[^\w]*/','',$string); // the [\d] will remove all numbers // the [^\w] will remove all non a-zA-Z0-9_ [/code]
  2. jworisek

    Two problems

    a php solution could be something like: (untested) [code] $i=0; $first_letter_old=""; while ($i < $num) { $name=mysql_result($result,$i,"name"); $category=mysql_result($result,$i,"category"); $first_letter=substr($name,0,1); echo "<a href='http://www.reef-break.com/cawcenter/svr2006/caw.php?name=$name'>$name</a><br>"; if (($first_letter!=$first_letter_old)&&($first_letter_old!="")){   echo "<br />"; } else{} $first_letter_old=$first_letter; ++$i; } [/code]
  3. try importing the data, then removing the primary key and try to insert data into the table... could it be that when you import this data file it isn't updating the position for the unique ID that you use? so after importing its still trying to dump it in at 1 when 1 already exists? You could also try setting your id value to a number you know isno't already in the table to see if that still causes the error.
  4. I could be wrong but I don't think it likes you using dashes as column names. That could explain why it is failing at the first - in the query. Try either putting the column names in back ticks or changing the dashes to underscores.
  5. well, you could just do something like this. You do need a condition in your while statment though.... [code] $count=0; while ( /*some condition*/ ){ $total = 3; $count++; } [/code]
  6. have you looked here? [a href=\"http://us3.php.net/manual/en/function.setlocale.php\" target=\"_blank\"]http://us3.php.net/manual/en/function.setlocale.php[/a]
  7. Are you sure you understand how php works? PHP is processed server side. Data is only sent to the browser after processing or until you break off from the php script. Your script is not processing indefinitely. Everytime a script runs it loads all the includes called for it.
  8. try this: [code] if (/*allowed*/){   $checked="checked=\"checked\""; else{/*not allowed*/   $checked=""; } echo "<input type='checkbox' name='option$member[id]' $checked> $member[display_name] ($member[clan_bank])<br>"; [/code]
  9. if you are keeping the database relational (Which I assume you are) I don't see why one database wouldn't be fine. As far as I know there isn't any real limit to tables in a database (I could be wrong). If you are trying to do a project like myspace though (depending on how many users you have) you might eventually need to think about multiple servers and load balancing.
  10. I hate to burst your bubble, but unless you tell us what is going wrong we don't know what is wrong either!
  11. the problem is you dont want to count, you want to SUM the data. Counting will increment for each row regardless of the data. try this: [code] $query= "SELECT QRatingNames.NamesID, SUM(fav_count+vg_count+g_count+fp_count+nh_count) as total_count FROM QRatingVotes2, QRatingNames WHERE QRatingVotes2.NamesID=QRatingNames.ID group by QRatingNames.NamesID"; [/code]
  12. what you say is exactly right... just add ?url=http://www....whatever or you could even just use php server variable to get the referring page. I like to add an error variable on to saty something like [code] $error_explain="Your Session has timed out.  Please log back in."; header("Location: http://domain/login.php?url=http://referrer&amp;error=$error_explain"); [/code]
  13. fixing the msg variable would help.... you were ending it before $password was put in it. [code] $msg="Your login and password are as follows: login Id:".$login." Password:" .$password. ""; [/code] also, use newline ( \n ) instead of <br> in $from for the php.ini, verify that you have a username and password set up for php to connect to you SMTP server. Also try setting SMTP = www.yourdomainname.com instead of localhost
  14. post your table structure... there is only a limit on rows based off your column type for auto increment.. for example a tinyint would only work for 0-255 (unsigned). Also, double check on your submit page... how do you know that it actually ever sent it to the DB? Post the submit page code as well.
  15. to use your existing code you should be able to just do this: [code] echo "<a href=\"$PHP_SELF?page=$page&product_id=".(($rowsPerPage * ($page-1)) + 1)."\">$page</a> "; [/code] so that the math operations are done [u]outside[/u] of the string.
  16. I would bet it is becuase of your column type... Are you using something like a varchar or char for that column? change your column to int and see if it still happens.
  17. just curious if anyone has any experience in setting up SSL on XP. I read up on a while back and it seemed that most pages were written for installation on a linux server. From what I understood certain files for SSL are included in linux distributions that you can use but on windows you would have to pay to use?
  18. Are there any security concerns with using $_SESSION for tracking user data?
  19. well, you can try modifying the mysql configuration file and changing the value to max_allowed_packet = 350M Why are you storing documents that big and are you sure your column type can support that?
  20. if you are trying to limit the query you need to add LIMIT to it... it is trying to run [code] ... ORDER BY DT_STRING 0,25"; // try this ... ORDER BY DT_STRING ASC LIMIT 0,25"; [/code]
  21. I don't think php is necessarily what you want to be using... You need something client side that checks for new messages. Java would probably be better suited for it I would imagine. I suppose that you could have a framed html document and the "chat window" refreshed every 10 seconds or so by sending a query to a database. But I could see that being a real pain in the ass. Not to mention all those unnessecary queries to the database.
  22. Recently we've been running into issues where we get booted out of ther server with the error "Unable to Connect". It seems like normally all that needs to be done is close IE down and restart it. I think its related to this (haven't tried it yet): [a href=\"http://dev.mysql.com/doc/refman/4.1/en/can-not-connect-to-server-on-windows.html\" target=\"_blank\"]Mysql manual[/a] Is there anyway to set up a log to monitor connection spikes (assuming this is whats causing it)? Anybody else ever have issues with this? --------------------------- Apache 2.0.52 MySQL 4.1.5-gamma Windows XP PHP 5.0.2
  23. thats definitely not the most efficient way of storing this information, but you can use [code] SELECT * FROM parts WHERE PNS LIKE '%C34%' [/code] consider looking into the "SET" type to store the information if possible. It looks to me like you just want to store a list of information and sorting through text in the method I show above is not very efficient.
  24. Believe me, I have stared at my fair share of queries and racked my brain only to find I had a typo ;)
  25. [!--quoteo(post=362319:date=Apr 6 2006, 12:42 PM:name=Phree)--][div class=\'quotetop\']QUOTE(Phree @ Apr 6 2006, 12:42 PM) [snapback]362319[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] $query = "UPDATE users SET phonedetails = ".$mms_phone_info."WHERE phonepwd='{$_GET['username']}'";[/code] [/quote] Is it just a typo that you have [b]".$mms_phone_info."WHERE[/b] with no space? if there isn't it will read it all as one word. Try : [code] $query = "UPDATE users SET phonedetails = '$mms_phone_info' WHERE phonepwd='{$_GET['username']}'";[/code]
×
×
  • 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.