Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Posts posted by The Little Guy

  1. I believe that mysql can only insert 1000 rows all at once, so you need to break it up into chunks of 40

     

    example:

     

    insert into my_table (col1, col2, col3) values
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    /* 1,000 ish rows */
    ('v1', 'v2', 'v3');
    
    
    insert into my_table (col1, col2, col3) values
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    ('v1', 'v2', 'v3'),
    /* 1,000 ish rows */
    ('v1', 'v2', 'v3');
    

  2. You shouldn't have to, my work does something similar, we have all of our php files on one server then the other severs mount that directory and can run the files like they were on that server.

  3. I have been trying WebDev, I got it set up but it isn't working I can not seem to connect to it. I can go to the url just fine although a 403 comes up. Not sure if it is supposed to do that in the browser or not, but I assume it is. I try to map the network drive but I get this error:

     

    The file cannot be accessed by the system.

     

    <VirtualHost *:80>
    ServerAdmin admin@hostbox.us
    ServerName  hostbox.us
    ServerAlias www.hostbox.us
    DocumentRoot C:/wamp/www/hostbox.us
    ErrorLog  C:/wamp/bin/apache/Apache2.2.21/logs/hostbox.us/error.log
    CustomLog C:/wamp/bin/apache/Apache2.2.21/logs/hostbox.us/access.log combined
    Alias /cdn "c:/cdn"
    <Directory "c:/cdn">
    	Dav On
    	#Order Allow,Deny
    	#Allow from all
    	#AuthType Digest
    	#AuthName DAV-upload
    </Directory>
    </VirtualHost>

  4. So you basically want to recreate Dropbox?

     

    Sure, but I don't want to physically store the files on the computer like dropbox does

     

    Dropbox stores the files remotely.

     

    But it also stores them on the computer that installs the software, which I don't want.

  5. Not 100% sure what I wanna do at the moment, but what I have in mind is:

     

    1.) you register an account

    2.) it creates a folder

    3a.) you can then connect to the folder and add/remove stuff from it

    3b.) you could use it to store web files and maybe use apache and set it as your server root dir

    3c.) use it as a backup device or anything really

     

    Basically use it as if it were a folder/directory on your computer but the files are not on your computer, they are on the server your connecting to, then if you upgrade your account and buy more space it would instantly be like adding larger HD to your computer.

     

    So say I make the folder somewhere in my root (C:\)

     

    I could go to:

     

    C:\remote_dir

  6. I would like to create a shared folder on my server, basically you connect to it and it is like a folder on your computer. You can drag files to/from it, open the file, example:

    if it is an mp3 it will start playing when opened, if it is a txt file it would open in an editor if opened, etc.

     

    But the files wouldn't be stored on your computer unless you copied them from this folder and pasted to a new location.

     

    basically You would connect like so: http://mysite.com/some_folder

     

    any ideas how?

  7. add a column with user_id:

     

    alter table table_name add column user_id int AUTO_INCREMENT;

     

    next when a user logs in save the information in a session:

     

    <?php
    // Connect to database
    $user = mysql_real_escape_string($_POST['user']);
    $pass = md5($_POST['pass']);
    $sql = mysql_query("select * from users_table where user = '$user' and pass = '$pass'");
    if(mysql_num_rows($sql) == 1){
    session_start();
    $row = mysql_fetch_assoc($sql);
    $id = $_SESSION['user_id'] = $row['user_id'];
    $name = $_SESSION['name'] = $row['name'];
    $addr = $_SESSION['address'] = $row['address'];
    $state = $_SESSION['state'] = $row['state'];
    $phone = $_SESSION['phone'] = $row['phone'];
    $email = $_SESSION['email'] = $row['email'];
    $message = <<<OPT
    User ID: $id
    Name: $name
    Address: $addr
    State: $state
    Phone: $phone
    Email: $email
    OPT;
    mail("tosomeone@somesite.com", "Title", $message);
    }
    ?>

  8. doesn't Apache have something similar to variables?

     

    just found this no idea if its good or not:

    http://www.cri.ensmp.fr/~coelho/mod_macro/

     

    What about something like this:

    <VirtualHost *:80>
    ServerAdmin admin@weblyize.com
    ServerName  %{HTTP_HOST}
    ServerAlias www.%{HTTP_HOST}
    DocumentRoot C:/wamp/www/%{HTTP_HOST}
    ErrorLog  C:/wamp/bin/apache/Apache2.2.21/logs/%{HTTP_HOST}/error.log
    CustomLog C:/wamp/bin/apache/Apache2.2.21/logs/%{HTTP_HOST}/access.log combined
    </VirtualHost>

  9. Off-Topic - Might want to do this:

     

    Not sure how you store your tags, but if you have one row per tag

    SELECT * FROM articles WHERE tags in('cars', 'motors', 'trucks') AND Id != 123 group by Id

     

    If  you have all tags in a text field (Not recommended):

    SELECT * FROM articles WHERE tags REGEXP 'cars|motors|trucks' AND Id != 123 group by Id

  10. I am no Apache expert, but I have been making virtual hosts for every subdomain I make, is there a way for me to only make on virtual host and it will do what ever it is that it does?

     

     

    so, instead of doing this for each subdomian I want, how could I make it dynamic so I only have to create one (is this even possible)?

    <VirtualHost *:80>
    ServerAdmin admin@weblyize.com
    ServerName  stats.weblyize.com
    ServerAlias www.stats.weblyize.com
    DocumentRoot C:/wamp/www/stats.weblyize.com
    ErrorLog  C:/wamp/bin/apache/Apache2.2.21/logs/stats.weblyize.com/error.log
    CustomLog C:/wamp/bin/apache/Apache2.2.21/logs/stats.weblyize.com/access.log combined
    </VirtualHost>

×
×
  • 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.