I am developing a theme, by having an admin page. Within the admin page function, I've this line:

$result1 = $wpdb->get_results("SELECT * FROM ".$table_name) 
or die(mysql_error()."wrong");

Within the admin page, "wrong" is printed. Basically comment this line, everything works fine, with the exception that I can not get individuals values. Before that, I additionally have this line:

$wpdb->query("CREATE TABLE IF NOT EXISTS ".$table_name." (
    url varchar (1023) NOT NULL,
    title varchar(511) NOT NULL,
    postpage varchar(511),
    link varchar(1023),
    PRIMARY KEY (id)
)") or die(mysql_error());

It really works fine. I have attempted everything, I can not get results.

Rather than using or die(), use $wpdb->print_error(); to print any errors that could have happened using the last query. So change

$result1 = $wpdb->get_results("SELECT * FROM ".$table_name) 
or die(mysql_error()."wrong");


$result1 = $wpdb->get_results("SELECT * FROM ".$table_name);

See the codex entry for the wpdb class for more reference.