Jump to content

MASS import affiliate links for photos


carefree

Recommended Posts

Without knowing anything about your csv file, or your gallery of pictures, the amount of advice I can offer is minimal. But I can point you in the direction of the fgetcsv() function that can help you parse a csv file - Look it up in the manual.

Link to comment
Share on other sites

Thanks for the reply.

 

Yeah functions are beyond me for the moment, but ive heard you can use sql to dump the csv file into the database like a table, is that true?? I know how to do a table dumb and use myphpadmin

 

I dont really want to mess up my whole site it took months to build.

 

I might get a freelancer to write a guide for me, it looks like one of those tricky things like installing ffmpeg codec ?? :'(

Link to comment
Share on other sites

How have you managed to build a site with PHP without any functions?! Using a function in PHP is nothing like installing a codec on your machine, they're hardly comparable! Did you even take a look at the manual page for fgetcsv()? There is a snippet of example code that should get you close to where you want to be!

 

<?php
$row = 1;
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $num = count($data);
    echo "<p> $num fields in line $row: <br /></p>\n";
    $row++;
    for ($c=0; $c < $num; $c++) {
        echo $data[$c] . "<br />\n";
    }
}
fclose($handle);
?>

 

You could pretty much drop everything inside the while() and replace it with an SQL query, matching up the keys in the $data array with the fields in your table.

 

I don't know how to import a csv with phpMyAdmin.

Link to comment
Share on other sites

I bought the program/site already built, im just modifying it atm. Im still only a php beginner, the coding youve given me is still ova my head atm.

 

Just thought there was an easy way to add associated links to pics, it was worth a try.

 

A table php dump is easy 4 clicks and your done ;)

 

Thanks for the help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.