User Profile

Collapse

Profile Sidebar

Collapse
Bakbai
Bakbai
Last Activity: Oct 28 '08, 09:11 PM
Joined: Oct 19 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Bakbai
    started a topic HELP. Position in row query
    in PHP

    HELP. Position in row query

    what i need is how to sum two or more columns with mysql and let php determine the the highest and lowest, by given it sum a position.
    here is my code which i earlier tried.
    [code=php]
    Select sum(score1+scor e2) from whatever table

    $x=0
    while($row = mysql_fetch_arr ay($result) {
    if ($user == $row['user']) {
    echo "$user is rank $x out of " . count($result);
    break;
    } else...
    See more | Go to post

  • Atli, thank you very mucg for your effort. you made me read well.
    i finaly got my solution. here it is for ref;
    [code=php]
    foreach ($_POST['code'] as $row=>$code)
    {

    $username = mysql_real_esca pe_string($code );
    $op = mysql_real_esca pe_string($_POS T['op'][$row]);
    $cl = mysql_real_esca pe_string($_POS T['cl'][$row]);
    $time = ($_POST['time']);

    $insertSQL =('INSERT INTO...
    See more | Go to post

    Leave a comment:


  • I will stop say thank you, b'cos i'm really learning more, so, thank you again.
    let me explain what i want to do.
    i've a form which post to a php file which will handle the insert process. the form is as below

    [code=html]
    <form method="POST" action="insert. php">
    <input type="checkbox" name="id[]" value="32">Arti cle #32<br>
    <input...
    See more | Go to post

    Leave a comment:


  • I've tried over the night but cant reach further, pls, what i need to understan is this;

    [code=php]
    $ref = $_POST['referer'];
    $query = 'INSERT INTO related_article s (id, referer) VALUES (' .
    implode(", $ref), (", $_POST['id']) . ", $ref)";
    $result = mysql_query($qu ery)
    or die('Could not execute INSERT query');

    \\Here's the query that is going to be executed:
    ...
    See more | Go to post
    Last edited by Atli; Oct 20 '08, 11:07 AM. Reason: Added [code] tags to your queries as well.

    Leave a comment:


  • Once more, thank you. i'll work on it and get back to you.
    You're trull helpful.
    See more | Go to post

    Leave a comment:


  • Thank you.
    with this code, it works ok.
    [PHP]ref = $_POST['referer'];

    $insertSQL = 'INSERT INTO aco (pin, test) VALUES (' .
    implode(", $ref), (", $_POST['id']) . ", $ref)";




    mysql_select_db ($database_scho ols, $schools);
    $Result1 = mysql_query($in sertSQL, $schools) or die(mysql_error ());
    if (!$Result1) {
    echo 'Sorry';
    }else...
    See more | Go to post
    Last edited by Atli; Oct 19 '08, 07:14 PM. Reason: Added [code] and [quote] tags.

    Leave a comment:


  • Bakbai
    started a topic pls can any one show me how i can add more array here
    in PHP

    pls can any one show me how i can add more array here

    already i've an array id, i want to add addional into the row.
    pls help!
    [PHP]$query = 'INSERT INTO related_article s (id, referer) VALUES (' .
    implode(", $ref), (", $_POST['id']) . ", $ref)";
    $result = mysql_query($qu ery)
    or die('Could not execute INSERT query');[/PHP]
    See more | Go to post
    Last edited by Atli; Oct 19 '08, 06:13 PM. Reason: Added [code] tags.
No activity results to display
Show More
Working...