Jump to content

ejaboneta

Members
  • Posts

    168
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ejaboneta's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

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