| Hello Cowboy, Well I've identified the problem records, will now try to remove these and start the sychron. process from scratch. But as promised here's the php code to incorporate your search into a page of results accessible from your browser. Might be missing the point of the search (so far as the next step involves accessing the database to remedy the situation.) but this is my first php code so I've learnt from the process anyway. Hope it is of use to mambo/ joomla/ smf users out there, please feel free to amend and change the script as you like. <? $username="USERNAME HERE"; $password="PASSWORD HERE"; $database="DATABASE NAME HERE"; /* This sets up the connection to your database via the details supplied above */ mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); /*Start of query supplied by Cowboy */ $query="SELECT jos1.id, jos1.username, jos1.email, smf.ID_MEMBER, smf.memberName, smf.emailAddress FROM smf_members smf, mos_users jos1 LEFT JOIN mos_users jos ON smf.memberName = jos.username WHERE jos.username IS NULL AND jos1.email = smf.emailAddress"; /*Create a variable called $result that totals up the number or rows or records retrieved from the query */ $result=mysql_query($query); $num=mysql_numrows($result); /*close the database connection, its not good practice to keep too many connections open */ mysql_close(); ?> <!-- We will output the results of the mysql query in a table --> <table border="0" cellspacing="2" cellpadding="2" bgcolor="#FFFFFF"> <tr bgcolor="#9CB2CE"> <th><font face="Verdana, Arial, Helvetica, sans-serif">Mambo ID</font></th> <th><font face="Verdana, Arial, Helvetica, sans-serif">Mambo Username</font></th> <th><font face="Verdana, Arial, Helvetica, sans-serif">Mambo Email</font></th> <th><font face="Verdana, Arial, Helvetica, sans-serif">SMF ID MEMBER</font></th> <th><font face="Verdana, Arial, Helvetica, sans-serif">SMF Member Name</font></th> <th><font face="Verdana, Arial, Helvetica, sans-serif">SMF Email Address</font></th> </tr> <? $i=0; while ($i < $num) { $mambId=mysql_result($result,$i,"jos1.id"); $mambUser=mysql_result($result,$i,"jos1.username"); $mambEmail=mysql_result($result,$i,"jos1.email"); $smfId=mysql_result($result,$i,"smf.ID_MEMBER"); $smfMember=mysql_result($result,$i,"smf.memberName"); $smfEmail=mysql_result($result,$i,"smf.emailAddress"); ?> <tr bgcolor="#EBEBEB"> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $mambId; ?></font></td> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $mambUser; ?></font></td> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $mambEmail; ?></font></td> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $smfId; ?></font></td> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $smfMember; ?></font></td> <td><font face="Verdana, Arial, Helvetica, sans-serif"><? echo $smfEmail; ?></font></td> </tr> <? $i++; } echo "</table>"; ?> |
Forum 





Author



Logged





