basically all i need to do is insert a php varible as field in mysql database.
To test it i used a static string, the function is as follows:
mysql_select_db($tNG->databasename, $tNG->connection);
mysql_query("ALTER TABLE tbl_subscribed ADD newField_sbd VARCHAR(255)");
It works once, then then mysql needs to restart before you can make any changes.
Any ideas.
SQL Alter table
Moderator: General Moderators
perhaps it helps if you modify your code like this:
Code: Select all
<?php
$hostname = "your_host";
global $hostname;
$username = "your_mysql_userl";
global $username;
$password = "your_mysql_passwd";
global $password;
$dbName = "your_default_db";
global $dbName;
$userstable = "your_default_table";
global $userstable;
MYSQL_CONNECT($hostname,$username,$password) OR DIE("Database connection failed.");
@mysql_select_db("$dbName") or die("Database not found.");
$query = "ALTER TABLE tbl_subscribed ADD newField_sbd VARCHAR(255)";
$erg = mysql_query($query) or die(mysql_error());
?>Greez,
- bluenote