Page 1 of 1

Retrieve Certain values

Posted: Sat Feb 13, 2010 12:06 am
by zalFG
help needed....

i have 17 values in one row of a table, but i only wanted to retrieve 15 value from that row(FieldValue) the last two values was not needed. i have attach the screenshot of the table for refferences...

sorry for my bad english...

and thank in advance..

Code: Select all

<?php
 
   $con=mysql_connect("localhost","root","");
      if(!$con)
        {
         die('Could not connect:'.mysql_error());
         }
 
mysql_select_db("kiperak",$con);
 
 
 
$result = mysql_query("SELECT Fieldvalue FROM kid_rsform_submission_values WHERE SubmissionId IN (SELECT SubmissionId FROM kid_rsform_submission_values WHERE FieldValue = '850830126317')");
 
 
while($row= mysql_fetch_array($result))
 
{
   -->" this code will show all the values in the row(FieldValue)"  echo $row[0];
 
      }
 mysql_close($con);
 
 ?>

Re: Retrieve Certain values

Posted: Sat Feb 13, 2010 1:43 am
by social_experiment

Code: Select all

<?php $result = mysql_query("SELECT Fieldvalue FROM kid_rsform_submission_values WHERE SubmissionId IN (SELECT SubmissionId FROM kid_rsform_submission_values WHERE FieldValue = '850830126317')"); ?>
In your query after 'SELECT' just add the fields you want to select, example Field1, Field2....Field15. Or you could use '*' and just use the values returned that you want.

Re: Retrieve Certain values

Posted: Sat Feb 13, 2010 2:45 am
by zalFG
Thanks for the reply, It's Work like a charm!!!! :D