Category Archives: StackOverFlow

Stack Overflow is a question and answer site for professional and enthusiast programmers.

How to make an add friend/defriend function in PHP?

I have created a site where people can create a profile. But I am trying to figure out how to start on making an add friend button so users can have friends.

In my user table, i have user_id, first_name, last_name, email, etc.

Should I somehow relate the user_id of the user and the friend in a friend table?

I am a novice to programming, so these things are still new to me. Thanks!

How to make an add friend/defriend function in PHP?

Flash Pro’s should be able to solve in seconds loading a movie

I have this action script that pulls images from a xml file

> myPhoto = new XML();
> myPhoto.ignoreWhite = true;
> myPhoto.onLoad = function(success) {
>   //portfolioTag = this.firstChild;
>   numimages =
> this.firstChild.childNodes.length;
>   spacing = 28;   for (i=0; i<numimages;
> i++) {        this.picHolder =
> this.firstChild.childNodes[i];
>       this.thumbHolder =
> thumbnails.createEmptyMovieClip("thumbnail"+i,
> i);       this.thumbHolder._x = i*spacing;
>       this.thumbLoader =
> this.thumbHolder.createEmptyMovieClip("thumbnail_image",
> 0);
>       this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
>       this.thumbHolder.title =
> this.picHolder.attributes.title;
>       this.thumbHolder.main =
> this.picHolder.attributes.main;
>       this.thumbHolder.onRelease =
> function() {          getURL(this.main,
> "_self");             loadMovie(this.main);
>           main_txt.text = this.main;      };  }
> }; myPhoto.load("languages.xml");

read more

import CSV into SQLite WITHOUT a table schema

I know that I can import .csv file into a pre-existing table in a sqlite database through:

.import filename.csv tablename

However, is there such method/library that can automatically create the table (and its schema), so that I don’t have to manually define: column1 = string, column2 = int ….etc.

Or, maybe we can import everything as string. To my limited understanding, sqlite3 seems to treat all fields as string anyway?

The names of each column is not so important here (assume we can get that data from the first row in the CSV file, or they could be arbitrary names) The key is to identify the value types of each column.

read more