Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 14:52
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  Searching MySQL data
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Searching MySQL data  (Read 5016 times)
mas_ab
Server what's that
*
Posts: 1


View Profile Email
« on: 12/05/05, 09:21 »

Hi all,

I'm a new member here  Grin and I have some questions about building a database (MySQL) search engine using AMFPHP.
I know how to display MySQL data in a datagrid (thanks to Jorge's tutorials  Smiley ) but I have no clue about searching data.

Q:
- How do I send a query to my database (using a  textinput comp.)  and then display the result in a datagrid?

A: ... ?

TIA,
--
Anggie Bratadinata
I N D O N E S I A
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 12/05/05, 09:48 »

Hi mas_ab, welcome to the Boards !

You need to pass a parameter to your amfphp method and use it in " WHERE ..." part of your query. Display in a datagrid have not change (is the same as using a select)

Jorge
Logged

elchea23
Server what's that
*
Posts: 33

elchea23@yahoo.com
View Profile Email
« Reply #2 on: 12/18/05, 08:21 »

Q : first play flash application  I want to display all record in grid Undecided then I want only curent record to dispaly.
      what a parameter after " where "  condition must be follow;
 
select * from city where nmcity=  $x

what is parameter of  "$x"

please help me???


From Indonesia
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #3 on: 12/18/05, 17:00 »

Sorry, don't understand your question, try to ellaborate.

Jorge
Logged

elchea23
Server what's that
*
Posts: 33

elchea23@yahoo.com
View Profile Email
« Reply #4 on: 12/19/05, 01:47 »

the table ---->city
I want flash first running (load) ----> show all record to the datagrid.
after that i want search a record in the text box and show in the same Datagrid.

i am use remoting(AMFPHP).

i want only a function php  query to show two  before process...

what is a syntax?Huh??.....Please

From
Indonesia


 
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #5 on: 12/19/05, 03:33 »

<?php
class search{
	
	
function 
search(){
	
	
	
$this->methodTable = array(
	
	
	
	
"searchRow" => array(
	
	
	
	
	
"description" => "Sear a row",
	
	
	
	
	
"access" => "remote"// available values are private, public, remote
	
	
	
	
	
"arguments" => array ("key")
	
	
	
	
)
	
	
	
);
	
	
}
	
	
function 
searchRow($key){
                        
$result mysql_query("select from mytable where columnToSearch='$key'")
	
	
	
return 
$result;
	
	
}
}
?>

This should be a method thart you add to the class, in my example I write a class with this only method. Replace mytable with the name of your table and columnToSearch with the column you want to filter.

Jorge
Logged

Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!