Jump to content

ejaboneta

Members
  • Posts

    168
  • Joined

  • Last visited

Everything posted by ejaboneta

  1. I'll try to provide as much details as possible. I'm creating a database of people with dynamic fields. To achieve this, I've created tables for `people`,`fields` and `values`. people: has an id and name fields: has an id and field name values: has an id, peopleid, fieldid, value, and delta(because there may be multiple values for certain fields) The index on the `values` table is set up with peopleid,fieldid,delta. Question 1: is this the best way to index the table? Question 2: if I wanted to search the table for first name(fieldid=0) and last name(fieldid=1), is this the best way to do it? SELECT f0.peopleid FROM `values` f0 JOIN `values` f1 ON f0.peopleid=f1.peopleid WHERE (f0.fieldid= 0 AND f0.value='John') AND (f1.fieldid= 1 AND f1.value='Doe') Please also let me know if there is a better way to structure the database and any other tips. Thank you.
  2. I'm having a weird issue with ksort. When there's a '+' in the key, it throws off the array order. (See example at http://codepad.org/iNCUGe07) for example: <?php $array = array( 'F+' => 'F+', 'N' => 'N', 'A' => 'A', 'M' => 'M', 'B' => 'B', 'D' => 'D', 'G' => 'G', 'C' => 'C', 'F' => 'F', 'K' => 'K', '0' => '0', ); ksort($array); print_r($array); ?> I'd expect this: Array ( [0] => 0 [A] => A [b] => B [C] => C [D] => D [F] => F [F+] => F+ [G] => G [K] => K [M] => M [N] => N ) But what I get is this: [A] => A [C] => C [0] => 0 [b] => B [D] => D [F] => F [F+] => F+ [G] => G [K] => K [M] => M [N] => N What's wrong? Update: I've figured out its a combination of 0 index and keys more than one character long, not the '+'.
  3. I want to plan for programming in .NET on my own but not if the differences are too great of a distraction from working with this program.
  4. My company purchased the rights to use and modify a program created by someone outside our company. It was programmed in VB6. I don't really have a choice.
  5. So far I've only done web related programming, html, php, mysql, js, etc. I am about to start working on an application that was programmed in VB6. I am a bit concerned about working with an outdated language so I might start learning .Net. I just don't want to start learning .Net if it will interfere with my understanding of VB6. I hope I explained my situation well enough. Just looking for some opinions. Should I start learning VB6 or should I go straight to .Net and figure out the differences along the way? I am planning on asking the developer if there are any plans on redoing the application in .Net in the future, but I don't think it's a solution at the moment.
  6. Sorry, lol..... Could you recommend a company that does some amazing SEO, SEM, SMM, and anything else that will result in high amounts of traffic?
  7. My company is looking to get high rankings fast! And yes, I do understand that these things take time to see results. I've been researching some decent priced seo services and we understood that one of our keywords would take a few months to get to the first page. But our business plans have changed a bit and we've decided to dedicate a much higher amount of funds on SEO services. We are willing to pay high costs in exchange for real results. Is there any company that can get us ridiculous amounts of (legitimate) traffic fast? Or rather, which companies can get us results the fastest? Excluding the black hats, of course.
  8. I've written a script thats going to take a really long time to execute... Whats the best way to do this as far as the server not timing out? My script is calculating some statistics based on other tables in the database and then storing them in another table. The results are going to be hundreds of thousands or maybe even millions of rows.
  9. I've made a user that only has Select access to the database... Is it possible to only give it Select access to just one or two views without any other views or tables, including the tables referenced in the granted views?
  10. I keep having probloms using mod_rewrite on my Godaddy Virtual Dedicated Server. I've been told over and over that Mod_Rewrite by default grabs the url invisibly. But in my case, instead of invisibly grabbing the url I want, it forwards the page to the url. And yes, I've made sure there is no Redirect flag. I've even tried [P], which works sometimes. So I am convinced that there is a setting somewhere that is making my Mod_Rewrite always forward. I can't find anything in httpd.conf. Can anyone help me? RewriteEngine On RewriteCond %{HTTP_HOST} blog.domain1.com$ [NC] RewriteRule (^.) http://blog.domain2.com%{REQUEST_URI} [P,NC]
  11. Thank you sasa. That worked perfectly.
  12. Even though $code prints out as "IMG", the switch doesn't see it as such. Oh and sorry, I didn't mean to reply to my post, I meant to modify it and I don't know how to delete it(if I can).
  13. I am trying to add some quick tagging features to my site where you put in a code like "[img:1]" and my function will translate that into an image with an id of 1. I though I could put the whole page in a variable and replace anywhere that matched the pattern. When I try to use a switch() inside the function that replaces the preg_replace matches, the variables I expect to be there, aren't there. It isn't working because the variable "IMG" and "1" show up as "$1" and "$2" to the code. Is there another way to do this? function gCodes($code,$var) { switch($code) { case "IMG": $img = getImage($var); $return = "<a href=\"$img[location]\"><img src=\"$img[location]\" alt=\"$img[title]\"/></a>"; break; default: $return = "$code=>$var<br>Not Working<br>"; break; } return $return; } $text = "[img:1]"; $content = preg_replace("/\[([A-Z]{3})[a-zA-Z0-9]+)\]/",gCodes("$1","$2"),$text); echo $content; The above example prints out: IMG=>1 Not Working
  14. Yes, that works, but it doesn't solve my problem. I fixed it by adding [P]. For some reason my server defaulted to redirect rather than mask the url... So a user would go to 'com/Free-Quote' but they would be redirected to 'com/index.php?p=Free-Quote'(showing in the address box)... I add the [P] and it works now without redirecting Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)$ index.php?p=$1/$2 [L,P]
  15. Sorry that I don't have a solution for you right now... But it might help you to look into arrays instead of saving the list as a string and having to add to it and explode it over and over. Also, if you store the shopping cart in the $_SESSION, there's no need to submit it through a form. Just call the $_SESSION variables in your mail script. Then you could have your script lookup each products name from the database... here's some things you should consider. you can use $cart as an Array(list). Use this to add the $_GET[id] to the cart list and keep track of quantity. $cart[$_GET['id']] = $_GET['qty']; To process the array you could use a foreach loop. foreach($cart AS $id => $qty) { //stuff }
  16. I'd just like to say that after spending a couple hours going through this forum... it's absolutely amazing how many times "how can I change http://mysite.com/index.php?id=343 to look like http://mysite.com/343/page-title?" is asked.... Can we find a good one and sticky it? It's just a little frustrating that I can't find anything relating to my problem... My urls go where they are supposed to but the url is changed back to an unclean url... for example: http://freemedigapquote.com/page/one
  17. I've done mod_rewrite a few times before, but this time apache redirects the page instead rewriting as I would expect it to. I'm using a godaddy virtual dedicated server so I have access to apache directly. I do this: RewriteEngine On RewriteRule ^([:\+.\)\(a-zA-Z0-9\_-]+)\/([:\+.\)\(a-zA-Z0-9\_-]+)$ http://domain.com/index.php?p=$1/$2 [L] and when I go to url "http://domain.com/page/one", the url changes to "http://domain.com/?p=page/one" instead of staying the clean url. Am I doing something wrong?
  18. I'll try the regex. I still need the html code, I just dont want it to be sent to my function translate(). something like this: $content = preg_replace('~<[^>]*>~',translate($1),$content);
  19. I'm trying to build a language translation function that sends content to google's translation service. The problem I'm having is that the html code is sent with it and I don't want that. So I'm trying to figure out a way to use preg_replace() to match anything thats not html code. I figure if I match anything thats not between < and >, I could get what I'm looking for. I'm just not sure how to do that. How can I do this?
  20. Back when I was jobless, I tried to exploit every one of my "talents", include sql, which at the time was more of a beginner hobby than a talent... One of the employment agencies I contacted sends me these job offers for jobs with titles like Sr Business Objects Developer which apparently is some form high level SQL programmer. Anyone have any insight into this profession and how to get into it?
  21. Id go with the dynamic where statement. I usually do this... foreach($_POST AS $field => $value) { $conditions[] = "$field = '$value'"; } if($conditions) { $where = "WHERE " . implode(' AND ', $conditions); } $query = "SELECT * FROM registration $where";
  22. Well looking at the source code for that url (http://www.yourvancouvermortgagebroker.ca/apply), it looks like you didnt add the form name.
  23. Yes, try that. Is your form on the page http://www.yourvancouvermortgagebroker.ca/apply? I was just looking at it.
×
×
  • 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.