Here is my problem. I need to sync up data from 2 separate databases.
The data in the first database is stored in one column, here is an example of the data: 3214, 3478, 3100
These number are the idProduct Primary Key from the Products table of the second database.
I need to separate the numbers the coma is the delimiter. each 4 digit number is a different product number from the second database.
The site is currently done in ASP and access database. I converted the databases to mySQL and redoing the site in PHP.
Here is the code from the asp page is it possible to convert this to PHP?
’ the regular expression will be used to filter out numbers from the commas
Set REsupplies = New RegExp
With REsupplies
.Pattern = “[0-9][0-9][0-9][0-9]”
.Global = True
End With
do until rs.eof or rs.bof
<%
Set expressionmatch = REsupplies.Execute(varSupplies)
if expressionmatch.Count > 0 Then
For Each expressionmatched in expressionmatch
varIdProduct = expressionmatched.Value
rs3.filter = "idproduct = "&varIdProduct
varProductName = rs3("description")
%>
<a href="ct_viewItem.asp?idProduct=<%=varIdProduct%>"><%=varProductName%>[/url]
<%
Next
end if
%>
I’ve gotten this far but now I’m not sure how to make each number pull up the records from the other database.
<?php $token = strtok ("3213,1234,5454,3100",", "); while($token){ print($token . " "); $token = strtok(", "); } ?>I need to make each 4 digit number pull up the record for the product in the second database.