Jump to content

xionhack

Members
  • Posts

    116
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

xionhack's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hello. In my business logic, I have a user, a company (users can be part of the company) and products. A product can be owned by a user or by a company, the company can assign it to a user later, but it would still be owned by the company (in case the company fires the user). My thought is to have the user table, the company table and the product table. I'm thinking about having a product_owner table, where I would have product_id, user_id, company_id, agent_assigned. If the product is owned by a user then only product_id and user_id will be filled. If it's owned by a company, then product_id, company_id and agent_assigned would be filled. Is this the best way to do it? It doesn't seem good to me.
  2. Hi! thanks for your reply. Is the saturdays in this month. I'll try to work with what u told me! Thanks!
  3. Hello! I want to be able to make a code that tells me how many saturdays have passed till today. I've tried a couple of things but nothing. Any help?! Thanks!
  4. Hello. I have a database with my blog addresses, I want to be able to populate a list of only the blogs that end with .blogspot.com. How can I do that? Thank you!
  5. Hello. I have an object like this: object->object_id object->object_name object->object_number I have an array with many instances of the object, with different values. I want to sort that array to put first the object that the value of object->object_number is higher, and then descending. Please let me know if its not clear! thank you!
  6. Hello. I want to create some variables dynamically. I have this so far: for($i = 1; $i <= 4 ; $i++){ $a = 'member' . $i; $$a = array(); } Does that give me this 4 arrays?: $member1, $member2, $member3 and $member4? Of course I want some process inside of the loop, but that would depend on the variables. Would that work? thanks!
  7. Hi, I was trying this code, but it only works for this month. Its not working for the next months.
  8. Hello. I have an organization where the members are grouped in teams, which have a team leader, and big groups, which have a group leader. It goes like this, one member can only have one team, meaning one team leader. One team (team leader) takes care of 1 or more than 1 members. 1 team can have 1 or 2 team helpers. Each team is part of 1 group. Each group have a group leader. The group leader is in charge of 1 or more than 1 group leaders. The way i have the tables set up is as follows: Member Table : member_id, name, group_id, team_id, helper_id Team Table: team_id, team_leader, team_helper, team_helper2 Groups Table: group_id, group_leader I dont know if thats the best way to do it, I actually feel its not even close. Does anybody has any input? Thanks!
  9. Hello. I want to generate the initial of the day of all the days of a chosen month. Meaning, if I choose this month it will give me: TFSSMTWTFSSMTWTFSSMTWTFSSMTWTF Is that clear? Can anybody help me? thanks!
  10. Hi! thank you! it works well! except for something. It doesnt want to take some links that are long like : http://www.facebook.com/album.php?aid=8228&id=680439301#!/pages/test/test-test/162482691457?v=wall Also, I dont want to get the mailto: tags but just leave them as mailto: . I was trying the following regular expression and code but its not working either, its not taking the attribute tags nor the mailto, I find regex so complicated!: $pattern = '%<a (??!href)[^>])*+href\s*+=\s*+"([^"]+)"[^>]*+>([^<]*+(??!</a>)<[^<]*+)*+)</a>%';
  11. Hello. I have a questions that I think its pretty much about regular expresions. I have this code: function create_link($matches) { // link_id should be an auto-increment field $insert = mysql_query(sprintf("INSERT INTO links ( link_url ) VALUES ( '%s' )", $matches[1])); return '<a href="' . mysql_insert_id() .'">'. $matches[2] .'</a>'; } // File name, could be a url $file = 'file.html'; if (file_exists($file)) { $content = file_get_contents($file); // Regex replace string $pattern = '/<a href="([^"]+)">([^<]+)<\/a>/s'; $content = preg_replace_callback($pattern, 'create_link', $content); echo $content; } What that does, is that it checks for all the links in a page, saves the links in a database and then swap the link address with the id of that link in the database. The problem that i have is that the code works when the link is just "<a href="" ></a>" but if the <a> tag has an attribute, then it wont work. i.e <a href="" id=""></a> OR <a id="" title="" href=""></a>
  12. anybody can help me with that regular expression?!
  13. Hi, thank you so much, it works like a charm! the only problem that it gives me is that if for example, instead of <a href=...> they write <a id=... href=...> it is not swaping them, nor when they do <a href=... title=...> , I tried fixing the regular expresion but it was just breaking the code. Any suggestions? thanks
×
×
  • 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.