You are here: Variable in select row « PHP Programming Language « IT news, forums, messages
Variable in select row

Posted by Garry Jones on 10/08/06 15:30

I want to Select a field based upon the number the user keys in I want to
retrieve another field from the same record

This is not working. How do I do it? The tricky bit seems to me to be
putting the variavble in the select quotes.

$scfchknum=$_POST['scfchknum'];
(inlogging mysql)
$upgcollect='SELECT scfpwd1 FROM scfmforening WHERE scfmnum = $scfchknum';
(logout mysql)
$pwd1=mysql_query($upgcollect);
mysql_close();
echo $pwd1;

$scfchknum is the value of the variable assign to user input
scfmforening is the name of the table
scfmnum is the name of the field I want to search in
scfpwd1 is name of the field I want to retreive from
$upgcollect is the data before it is processed with query
$pwd1 is the data after it is processed.

Greatful for any help.
Garry Jones
Sweden

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация