Advertisement:

i know this should work...

Aloittaja Spidy, tammikuu 27, 2007, 06:34:51 AP

« edellinen - seuraava »

Spidy

because i know its been used before so i wonder if any of you can help please...

i have a php script that i know has been used before to insert an access database into an sql one but i cant seem to get it to work, anybody see the problem with it n could tell me what the right argument to put in line 17 is to get it running n stop me getting this?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/public_html/convert.php on line 17

the script is below and any help is greatly appreciated thank you...

<?php
header
("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
        include(
"con.php");

echo 
"<?xml version=\\\\"1.0\\\\"?>
";
echo "<!DOCTYPE wml PUBLIC \\\\"-//WAPFORUM//DTD WML 1.1//EN\\\\" \\\\"http://www.wapforum.org/DTD/wml_1.1.xml\\\\">";
echo "<wml>";
echo "<card id=\\\\"card1\\\\" title=\\\\"Register\\\\">";
echo "<p align=\\\\"center\\\\">";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$no="0";
$result=mysql_query("select * from memberdb");
$number_of_rows = mysql_num_rows($result);
$count=0;
while ($count<$number_of_rows){

$permission = 40;
$username = (mysql_result($result,$count,"un"));
$date = (mysql_result($result,$count,"signdate"));;
$phone=NULL;
$name=(mysql_result($result,$count,"name"));
$location=(mysql_result($result,$count,"home"));
$age=(mysql_result($result,$count,"age"));
$sex=(mysql_result($result,$count,"sex"));
$about=(mysql_result($result,$count,"about"));
$email=(mysql_result($result,$count,"mail"));
$password=(mysql_result($result,$count,"pw"));
$picture= (mysql_result($result,$count,"pic"));
$cookieid=NULL;
$lastpost = 5;
$voted=0;
$subno=$_SERVER['HTTP_X_UP_SUBNO'];

$validated="yes";
$sql = "INSERT INTO memb (username,password,phone,subno,lastpost,email,registerdate,lastloggedin,validated,device) VALUES('$username','$password','$phone','$subno','$lastpost','$email','$date','$date','$validated','$cookieid')";
$result2 = mysql_query($sql);

$sql = "INSERT INTO prof (username,name,age,sex,location,about,picture) VALUES
('$username','$name','$age','$sex','$location','$about','$picture')";
$result2 = mysql_query($sql);
$count=$count+1;
}
echo "</p>";
echo "</card>";
echo "</wml>";
?>

Advertisement: