Jump to content

miancu

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Posts posted by miancu

  1. try to use an INNER JOIN instead of this select from 2 tables. Also manipulate the $email var before adding it to the query so it is in the needed format 'email1@..,email2@..' and add the var  without the ''. try it like this:

     

    SELECT u.avatar, u.displayname, p.about_me

          FROM users  u INNER JOIN profiles p ON p.user_id = u.id

        WHERE u.email IN ($email) AND  LIMIT $offset, $rowsperpage

     

    hope this helps!

  2. Does this help?

     

    // I assume you know which project ID you want = $projectID
    echo "projectname: ". $projects[$projectID]['projectname'] . "<br />";
    echo "targetlang: ". $projects[$projectID]['targetlang'] . "<br />";
    //... more values to display  here according to the key - targetlang , sourcelang , units  
    

     

    If this is not what you need, please give more details, because I am a little confused on what you need here.

  3. I think you got lost in so many arrays you're using. If I understand correctly your needs, you might be able to simplify your $rows array when you retrieve the data from database:

    $projects = array(); //this is instead of your $rows
    foreach($projectIDs as $row => $value) {
    $query = mysql_query("SELECT * FROM ".PROJECT_TABLE." WHERE id = '$value' ");
    $row = mysql_fetch_array($query);
    
    $projects[$row['id']] = array();
    $projects[$row['id']]['projectname'] = $row['projectname'];
    $projects[$row['id']]['projecttype'] = $row['type'];
    $projects[$row['id']]['sourcelang'] = $row['sourcelang'];
    $projects[$row['id']]['targetlang'] = $row['targetlang'];
    $projects[$row['id']]['units'] = $row['units'];
    // continue here with rest of variables you have	
    }	
    

    You could then use $projects array for further display or manipulation.

    Let me know if this helps you!

     

  4. My idea will be to have a separate function where you get all results from database with (post_numb>just deleted post_numb) ordered by post_numb ASC and using an counter(in PHP) to update each  field post_numb  with that counter(that starts from just deleted post_numb to the total number of records).  You call this function every time you do a delete post and have the deleted post_numb as a param for the function.

     

    If you have a lot of records in the database, this function might be a little time consuming, so you might just want with the second option I have you.

     

    Hope this is helpful!

     

  5. maybe every time you have the delete post operation called, you can add a function called to reorder the post_numb values to avoid having missing numbers. or maybe you should just get them ordered from database after the post_num and then use an index to display #1,#2, etc in the php.

    hope this helps!

  6. try  something like:

     

    SELECT a.* FROM allusters a

            INNER JOIN doctors d ON a.id=d.obj_id

    WHERE d.value='provider'

     

    if I understood the requirement, this should work to give the allusters that are providers.

    hope this helps!

     

     

  7. Hi everybody!

     

    My name is Miha, I am from Romania, but I've been living in US for almost 2 years now. I've been developing in PHP(also HTML/CSS/Javascript and Mysql)  for 5 years now, and I've been involved in various projects, small or big. I am sure I still have a lot to learn and I am here to see what else is there in the PHP world and web application architecture as well as to offer my help and advice when I can.

     

    See you guys around here!

     

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