PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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...
<?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);
?>
Attachments
this is the table
2-13-2010 11-52-08 AM.png (34.66 KiB) Viewed 40 times
<?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.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering