1
GlouGlou
Problem creating a bulk insert script.
  • 2004/7/5 13:46

  • GlouGlou

  • Just popping in

  • Posts: 1

  • Since: 2004/7/5 1


First of all i hope i posted in the right category.

I wanted to migrate my file database from my previous CMS to Xoops.

So, i made a small script to write directly in the xoops_mydownloads_mydownloads database and into the xoops_mydownloads_text database. My problem is: when i click on the link inserted, it doesnt work because XOOPS modify the url after i click on it

here is my insert query

$InsertQuery=
"insert into xoops_mydownloads_downloads "
. "(cid,title,url,size,logourl,submitter,status,date,homepage,version,platform) "
. "values (2,"
. "\"" . $title
. " \", \"" . $DownloadBaseUrl .$file . "\","
. filesize($file)
. ",\"". $ShotBaseUrl . $logourl
. "\",1,1,1088797669,\"\",\"\",\"\")";

and here is my insertcomment query ->

$GetMaxLidQuery=
"select MAX(lid) as truc from xoops_mydownloads_downloads";

$result = mysql_db_query($dbname, $GetMaxLidQuery) or die("Query failed with error message: \"" . mysql_error () . '"'. " ". $GetMaxLidQuery);

$MaxLid = mysql_result ($result,0,0);

$InsertDescriptionQuery= "insert into xoops_mydownloads_text (lid,description) values (". $MaxLid . ",\"". $FileDescription ."\")";


cid must be 2 because all files are in cat 2, i put a fake date (which is a real one) and status is "1" (i dont know what status is).

I have very low experience with Xoops/PHP and mySQL so maybe im missing something.

Thx in advance.




TopTop



Login

Who's Online

192 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 192


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits