vsc.five-star.com
May 24, 2012, 03:25:37 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Just added new superheroe avatars. Also, fixed the quick reply section and added a few other things here and there to clean things up a bit.
 
   Home   Help Search Login Register  
Pages: [1]
  Send this topic  |  Print  
Author Topic: If you need help...  (Read 838 times)
haarvik
phpBB Manager
*****
Posts: 59


View Profile
« on: November 18, 2005, 11:33:40 AM »

I am a PHP/MySQL developer.  If you need help with anything, just let me know.  I will do what I can to contribute.
Report to moderator   Logged
mcsvls
phpBB Assistant Manager
****
Posts: 37


View Profile
« Reply #1 on: November 19, 2005, 10:27:11 AM »

haarvik,

Had a quick question about php/sql.  

What is the process of integrating a live inventory if you have
a POS that supports it!

You can email me at mcs@carolina.rr.com

Thanks

Mark S
Report to moderator   Logged
haarvik
phpBB Manager
*****
Posts: 59


View Profile
« Reply #2 on: November 19, 2005, 03:36:20 PM »

Hi.  If your DB supports it, you basically need to design your php code to perform queries on the related tables within the db.  For example, if I were using MySQL and had a db named movies and within that db I had a table called new (new releases).  My table might be structured so:
 
Title
Rating
Released
Status
 
Now, in order to see if the particular movie is in you perform a query like so:
 
select*from new where(title='Star Wars')
 
This would return any fields within the table new.  To perform this with PHP, you have to make sql calls to the db in a similar fashion:
 
$host='localhost';
$db='movies';
$user='username';
$pass='password';
 
mysql_connect($host,$db,$user,$pass)or die("Cannot select db");
$sql=select*from new where(title=$title);
$result=mysql_num_rows($sql);
$num=mysql_result($result);
 
$i=0
 
if($num > $i){
 
$title=mysql_result($result,$i,"title");
$status=mysql_result($result,$i,"status);
 
print "$title is $status";
 
$i++;
}
 
So this returns the $title Star Wars, and if the status was out, then $status would be Out, and displays it on a web page.  Now if you are using Microsoft SQL, then the syntax for connecting is slightly different.  I've never coded for M SQL so you would have to google for the correct syntax.  It is very similar, but there are noticable differences.
 
Hope this helps.
 
Tom
Report to moderator   Logged
Pages: [1]
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!