Hi people, im having trouble composing this query, and was wondering if anyone can help🙂
i have two tables, as below;
Table 1 (data)
id, username, password, email, location, connection, last_ip, disable, last_action
Table 2 (file_data)
id, username, filename, size
Incase you havent guessed, im using PHP along with VB to make a Peer2Peer like Kazza. Im using PHP to input the data from VB into my MySQL Database. Im working on searching these tables for a file name that a users specifies ($str). In the search results i want:
filename
size
username
location
connection
last_ip
Basically, all ive got at the moment is this, that grabs data from the 'file_data' table;
$sql = mysql_query("SELECT * FROM file_data WHERE filename like '%" . $str . "%'");
However, last_ip, connection, and location are held in the 'data' table.
Can anyone help me conduct a query that will search the 'data' table, as well as the 'file_data' table. I belive i would need some sort of 'join' command. Ive looked this up in the MySQL manual, but i cannot get it 2 work🙁
So, your my last chance really! I hope ive explained thoroughly! Any help would be great.
Best Regards,
Jonathan