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...
User Profile
Collapse
-
HELP. Position in row query
-
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... -
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...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:
...Leave a comment:
-
Once more, thank you. i'll work on it and get back to you.
You're trull helpful.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...Leave a comment:
-
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]
No activity results to display
Show More
Leave a comment: