User Profile

Collapse

Profile Sidebar

Collapse
canabatz
canabatz
Last Activity: Nov 21 '23, 03:30 PM
Joined: Oct 23 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • canabatz
    replied to copy rows
    in PHP
    Thanks to all for helping .
    this is the final result! working perfect!

    i know it looks much more complicated from what i ask :

    Code:
    $sqlSURVEY_AnsSUid=mysql_query("SELECT *  FROM `xp_survey_answer` ")or die(mysql_error());
    
    while ($rowSURVEY_Ans=mysql_fetch_array($sqlSURVEY_AnsSUid))
    {
    $ans_su_id[]=$rowSURVEY_Ans['ans_su_id'];
    }
    
    $str2 = implode(',',array_unique($ans_su_id));
    ...
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    this is what i got so far, it's working well , i need a little more tweaking .
    Code:
    // geting max 
    $sqlSURVEY_Amax=mysql_query("SELECT max(ans_q_id) as maxq  FROM `xp_survey_answer` ")or die(mysql_error());
    $rooo=mysql_fetch_assoc($sqlSURVEY_Amax);
    
    $maxq=$rooo['maxq'];
    
    // end geting max
    
    // puting all in arrays
    $sqlSURVEY_Ac=mysql_query("SELECT *   FROM `xp_survey_answer`  where
    ...
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    i tryd with the MAX(A_Q_ID) to add +1 to the new created rows ,but it's not working.

    im going to write my question and ask how would you do that.

    if you got this for example:

    ---pos----A_Q_ID
    ----1-------33--
    ----2-------33--
    ----3-------33--
    ----1-------34--
    ----2-------34--
    ----3-------34--


    now, i want to duplicate those rows to have new rows like that:...
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    Second option not working too :(

    any idea?
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    Ok , I will try it when I'm In front of my computer.
    Thanks man
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    I hope it will do the trick .

    Some have more rows like that:

    Pos-----------A-q-id
    1------------------5---
    2------------------5---
    3------------------5---
    4------------------5---
    1------------------6---
    2------------------6---

    How I can do it if it's like that?

    Thanks
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    thanks, this i allready done.

    the problem is that A_Q_ID is not auto increment.

    if you look at the position it got 1,2,3 this is 3 options ,and the A_Q_ID is the same.

    what im trying to accomplish is to duplcate the 3 options but have them with different A_Q_ID.

    so if i got it like that:

    pos-----A_Q_ID
    1--------3----
    2--------3----
    3--------3----
    1--------4----...
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to copy rows
    in PHP
    i will ask again but differently so it will be easier for understanding what i need.

    i got this rows right now

    id----------position-------------A_Q_ID
    1---------------1--------------------5-----
    2---------------2--------------------5-----
    3---------------3--------------------5-----
    4---------------1--------------------6-----
    5---------------2--------------------6-----
    6---------------3--------------------6-----...
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to directory not show in website
    in PHP
    it's probably security problem.

    it can be .htaccsee to take you back to the default index.php if he cannot find any thing, or directory permission is not allowing you to see the content of the directory.

    you should echo the file path in a loop if there is more files to download.

    hope it helps.
    See more | Go to post

    Leave a comment:


  • load the included file alone to see if it's working at all.
    if it is , then it's something else.
    See more | Go to post

    Leave a comment:


  • canabatz
    started a topic copy rows
    in PHP

    copy rows

    Hi,

    i want to duplicate rows in a table.

    i got this for example:



    what im trying to do is duplicate all rows in the same table.

    what i got so far is:

    Code:
    $sql=mysql_query("SELECT `ans_id`, `ans_caption`, `ans_position`, `ans_su_id`, 'ans_q_id'   FROM `MY_TABLE`  where ans_su_id='2'");
    $row=mysql_fetch_assoc($sql);
    $num=mysql_num_rows($sql);
    ...
    See more | Go to post

  • canabatz
    replied to select single row by id in php mysql
    in PHP
    Code:
    $sql=mysql_query("select * from `yourtable` where id='theid'")or die(mysql_error());
    $row=mysql_fetch_assoc($sql);
    echo $row['name1'].$row['name2'].$row['name3'].$row['name4'];
    hope it helps
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to LIMIT problem!
    in PHP
    there is a way to combine the two querys?

    to make them one!
    See more | Go to post

    Leave a comment:


  • canabatz
    started a topic LIMIT problem!
    in PHP

    LIMIT problem!

    i got this code:

    Code:
    $sql_f="SELECT reg_id, count(bid_price) as cnt, min(bid_price) as low FROM `bidding_details` where bid_id='$bid_id' and sortbid = '1' group by reg_id HAVING COUNT(reg_id) > 9  limit 50";
    $results=mysql_query($sql_f)or die(mysql_error());
    $row = mysql_fetch_assoc($results);
    $num = $row['low'];
    $cnt = $row['cnt'];
    
    if($cnt > 9) {
    
    $sql_u="update
    ...
    See more | Go to post

  • canabatz
    canabatz posted a Visitor Message for canabatz
    בונקר מכרזים
    See more | Go to post

  • canabatz
    replied to indexing
    ok ,thanx :)

    one more question :)

    i got my database as default MyISAM !

    i got some time slow inserts and updates ,there can be like 5 inserts every second
    i read that InoDB is better in insert delete and update!

    are you recomend to move to InoDB? if i got allot of insert ,update?

    thanx
    See more | Go to post

    Leave a comment:


  • canabatz
    replied to indexing
    thank's

    ok ,i got it!!

    one more question :)

    i want to understand what query will be faster:

    if i do:

    SELECT * FROM 'my_table' where id=$id;

    and from my_table i only need those columns first_name , last_name, user_name and there is much other columns in the table that i dont need.


    or i do like :

    SELECT first_name, last_name,...
    See more | Go to post

    Leave a comment:


  • canabatz
    started a topic indexing

    indexing

    Hello ,i tryed to search for this topic ,and i didn't find!

    im new to optimizing mysql by indexing ,and i want to know if it is good?

    i got this table with users registration details , i got username, first_name, last_name, and some more !

    my question is :

    is it good to index all this 3 fields ?

    thank's
    See more | Go to post

  • canabatz
    started a topic ranking!
    in PHP

    ranking!

    i got this code for ranking users input to the data base
    Code:
    $resultr = mysql_query("SELECT id, rank FROM bidding_details where bid_id=$bid_id and sortbid='1' ORDER BY bid_price DESC");
    $rank=1;
    
    while ($myrow=mysql_fetch_row($resultr)) {
    
    $id = $myrow[0];
    mysql_query("UPDATE bidding_details SET rank=$rank WHERE bid_id=$bid_id and id=$id and sortbid='1'");
    
    $rank++;
    ...
    See more | Go to post

  • canabatz
    replied to limit problem when using update.
    in PHP
    thanx alot Zorgi!!!!

    i will try that ,and come back with the solution!!

    thanx!!!!
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...