« first day  last day (14 days later) » 

2:17 AM
i think its best to do it are there any drawback to doing it like this?im not sure which is better
the code i answered there can be used if you create database before hand in myphpadmin
i want to make it that even if you dont make a database in myphpadmin it will still work
 
3:09 AM
@satinekianne
are you there
 
yes sir
i dont understand this remove dbname and use root?
 
does your db exist
in php my admin do you see it
 
yes but it exist because i made it manually in myphp what i want is i make the db from scratch from code
 
so the admins will be creating multiple databases
is that why you want it through code
 
no multiple tables one database
 
3:18 AM
$dbh = new PDO("mysql:dbname=$dbb;host=localhost", "root", "" );
 
line one table for admin user one table for not admin user something like that
 
this is the line you should change
$dbh = new PDO("mysql:host=localhost", "root", "" );
the database does not exist
yet you connect to it prior to CREATE
 
so i need to create first then do the line
ok brb
 
you need to connect to the server just the host
than create the db
then selected the db
so you can create the table
 
how do i select db i havent done it yet
 
3:23 AM
$dbh->query("use $dbb");
 
i have that code in my update
let me try my update i havent really tried to delete my database because im focusing on making many tables
i will delete my databse and create it from scratch and will be back on you
 
yes
I am talking about this
$dbb = 'memberdb';
$table = "member";
$events = "events";
try {
//$dbh = new PDO($dsn, $login, $password,$opt);
    $dbh = new PDO("mysql:dbname=$dbb;host=localhost", "root", "" );
    $dbname = "`".str_replace("`","``",$dbb)."`";
    $dbh->query("CREATE DATABASE IF NOT EXISTS $dbname");
    $dbh->query("use $dbname");
$dbname seems to be undefined
it should be $dbb
and not in the connection string because it does not exist yet
 
i see
now i understand
 
3:43 AM
its ok and i tried an answer it create two table
i will rerun just to be sure
i will be back on you on this thank you so much for explaning
 
4:03 AM
your welcome
 
 
4 hours later…
8:23 AM
$dbh = new PDO("mysql:host=localhost", "root", "" ); im doing this line now what do i put in database ffrom the start since the database is not created yet
 

« first day  last day (14 days later) »