0

I'm new in mysql language and can not understand difference between procedures and functions, can anyone answer in which case should be use this routines ?


Also have some example => I've table named "data" and columns named "id"(primary key) , "local". this local includes multiple exactly same data. I want to search every id of this "data" (and after result manipulate with it) table which local equal to (for instance) 'something'

Please answer in this question ... Thanks

DaHaKa
  • 161
  • 1
  • 1
  • 6

2 Answers2

0

Functions:

 select <function>(column) from table where <condition>;

Procedure:

 call <procedure>( param0, param1 );

To get your result:

 select * from <table> where data like "%something%";
ethrbunny
  • 10,379
  • 9
  • 69
  • 131
0

I suppose that you use php with mysql.

your query should be

$result = mysql_query("SELECT * FROM data WHERE local='something'");
while($row = mysql_fetch_array($result))
{
     // here you manipulate with your data
     // for example:
     echo $row['id'];
}
10robinho
  • 520
  • 6
  • 17