Jump to content

juice

Members
  • Posts

    14
  • Joined

  • Last visited

juice's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. thanks so much foxy.. i really appreciate it.. i'm gonna try learning and implementing it the advanced way with php, jquery and ajax..
  2. so i'm tryna figure out how to implement a strategy i see google and some other websites use.. I've been tryna figure out how do they list their results with incrmental search options.. like (1, 2, 3, 4.. etc..), like each number you choose you get a different list of search results.. i want to implement this on a tryout website where i can display a list of news, that i will keep adding more and more news updates to.. i would like to know how should i use this same technology on my own website... >>>>Would i have to make a special incremented database table for news and formulate a special query to return a certain amount of rows at a time and display it appropriately. then caluculate how much numbers to display on the website by the the amount of data in the database table.. the numbers would display the most recent updates to the least as expected.. i have no idea, i'm just brainstorming on what i think is most practical from my level of knowledge... Can someone please help me i'm tryna prepare for a job.. thanks much for the help...
  3. juice

    php and mysql

    thanks for all the advice but as i said in the beginning its for a school project and i want the code to be portable.. so i can transfer it to my schools' computer and it will automaticall create the database tables, which will make my website fully functional... i found the problem in my code after trial n error.. it was the quotation marks i placed in my SQl queries... i'm tryna finish it right now with msqli cause there's alot more documentation and examples online for it than PDO.. but when i'm done i will try doing it in PDO as well, it seems easier and faster to code because or its object oriented nature...
  4. juice

    php and mysql

    over 5 hours now n i still can't create a table.. any suggestions? im gonna try using PDO tomo, if i don't get any luck..
  5. juice

    php and mysql

    well i added the database to the phpmyadmin, manually and then tried to connect to it wih php.. i used mysqli.. it connected .. now i'm having trouble adding the tables with php code but i'll get around it sooner or later... thanks for everyones help... if i get any other problem i will let you'll know...
  6. juice

    php and mysql

    ok thats a good idea.. thanks
  7. juice

    php and mysql

    what do you mean justsomeguy, can you explain a bit further please?
  8. juice

    php and mysql

    yh.. im using xamp.. i even reinstalled it last night.. installed the latest phpmyadmin to.. every thing is up to date.. so far i tried; mysql, mysqli, PDO and now perl and nothing is working.. im really beigining to think its a configuration problem in the phpmyadmin, mysql server or xampp.. can anyone tell me what should i try.. im using the latest php 5.5.9, phpmyadmin 4.1.13, MySQL 5.6.16 and apache 2.4.7... this is really keeping me back now n giving headaches..
  9. juice

    php and mysql

    as i said it has to be some configuration problem with the phpmyadmin.. nothing is not working
  10. juice

    php and mysql

    i'm starting to think now its a problem the phpmyadmin... i've tried 3 different ways now.. mysql, mysqli and now PDO.. can any one suggest something i could try or tweak.. here's the PDO code i hav now <?php$db_name="dscdb";$db_user="root";$db_password="";$db_server="localhost";$user='admin';$password=""; $dbconn = new PDO(mysql:host = $db_server; $db_name; charset = utf8, $db_user, $db_password); // create a new database $dbconn->exec("CREATE DATABASE '$db_name`; CREATE USER '$user'@'localhost' IDENTIFIED BY '$passw'; GRANT ALL ON `$db_name`.* TO '$user'@'localhost'; FLUSH PRIVILEGES;") or die(print_r($dbconn->errorInfo(), true)); // check to see if database was successfully created if($db_name){ echo 'connected to database'; } else { echo 'Not Successfuly Created'; } $dbconn = null; ?>
  11. juice

    php and mysql

    i tried mysqli.. but still nothing. im still tryna figure erything out with the PDO
  12. juice

    php and mysql

    thanks alot though davej, doing some reseach on pdo now.. Every things seems to make alot of sense for now, if i encounter any problems i will let the forum know..
  13. juice

    php and mysql

    so that means i should keep nothing?
  14. juice

    php and mysql

    im creating a simple website and database for a project with minimal functionality. All i'm supposed to do is create a website that communicates with a database. i chose to do that project with php, ajax and mysql in xamp. Now i've decided to work on the database first, i want it to be portable where i can just put the completed code in folder on a flash drive and go to school with it. where i'll jus be able to copy it to the htdocs folder in the xamp and it will automatically create the database and run all the queries. For some reason, no matter what i try it won't show up in the phpmyadmin databases section. I desperately need help, i wanna kno if my idea is possible and how can i go about it.. here's my code.. thanks much to any help, will be greatly appreciated.. the config.php <?php$db_name="dscdb";$db_user="root";$db_password="";$db_server="localhost";?> heres my connection mysqlconnection.php <?phpinclude($_SERVER['DOCUMENT_ROOT'].'/FinalProject/config.php');$con=mysql_connect($db_server,$db_user,$db_password) or die("Connection Failure: ".mysql_error());mysql_select_db($db_name,$con); ?> and heres my database and query creation.. setup.php <?phpinclude($_SERVER['DOCUMENT_ROOT'].'/Finalproj/config.php');{$con = mysql_connect($db_server,$db_user,$db_password); // database connect//Database creation mysql_query("CREATE DATABASE IF NOT EXISTS $db_name" $con) or die("creating database fails".mysql_error()); USE $db_name; mysql_select_db($db_name) or die(mysql_error()); //Students Table creation mysql_query("CREATE Table IF NOT EXISTS 'Students'('StudID' varchar NOT NULL (15) , primary key (StudentID), 'FirstName' varchar(15) NOT NULL, 'LastName' varchar (15) NOT NULL, 'BirthDate' DATE NOT NULL, 'Address' varchar(30) NOT NULL, 'MajorTitle' Foreign key (MajorTitle) References Majors(MajorTitle) NOT NULL, 'Username' varchar(15) NOT NULL, 'Password' varchar(8) NOT NULL)") or die("Failed to create Table".mysql_error()); mysql_query($con,"INSERT into Students(StudID, FirstName, LastName, BirthDate, Address, MajorTitle, Username, Password) values ('123', 'lee', 'daniel', '1990-01-08', 'Bioche', 'Computer Science', 'lee', 'daniel')"); mysql_query($con,"INSERT into Students(StudID, FirstName, LastName, BirthDate, Address, MajorTitle, Username, Password) values ('456', 'danphil', 'daniel', '1992-06-25', 'Bioche', 'Electronics', 'danphil', 'daniel')"); mysql_query($con,"INSERT into Students(StudID, FirstName, LastName, BirthDate, Address, MajorTitle, Username, Password) values ('789', 'eber', 'raver', '1988-03-28', 'Colihaut', 'Physics', 'eber', 'raver')") //$hashedpassword=sha1("password");// Instructor Table creation mysql_query("CREATE Table IF NOT EXISTS 'Instructors'('InstrucID' varchar NOT NULL (15), primary key (InstrucID), 'FirstName' varchar (15) NOT NULL, 'LastName' varchar (15) NOT NULL, 'Address' varchar(30) NOT NULL, 'Username' varchar (15) NOT NULL, 'Password' varchar(8) NOT NULL) ") or die("Failed to create Table".mysql_error()); mysql_query($con,"INSERT into Instructors(InstrucID, FirstName, LastName, Address, Username, Password) values ('abc', 'larry', 'thomas', '1982-09-14', 'Goodwill', 'larry', 'thomas')"); mysql_query($con,"INSERT into Instructors(InstrucID, FirstName, LastName, Address, Username, Password) values ('def', 'james', 'victor', '1986-09-06', 'Grandbay', 'james', 'victor')"); mysql_query($con,"INSERT into Instructors(InstrucID, FirstName, LastName, Address, Username, Password) values ('ghi', 'barnaby', 'jack', '1977-11-23', 'ireland', 'barnaby', 'jack')");//Registrar Table creation mysql_query("CREATE Table IF NOT EXISTS 'Registrars' ('RegID' varchar NOT NULL (15), primary key(RegID), LastName varchar (15) NOT NULL, Username varchar (15) NOT NULL, Password varchar(15) NOT NULL) ") or die("Failed to create Table".mysql_error()); mysql_query($con,"INSERT into Registrars(RegID, LastName, Username, Password) values ('abc123', 'jones', 'jones', 'jones')"); //Majors table creation mysql_query("CREATE Table IF NOT EXISTS 'Majors' ('MajorType' varchar NOT NULL (15), primary key (MajorID), 'MajorTitle' varchar (20) NOT NULL)") or die("Failed to create Table".mysql_error()); mysql_query($con,"INSERT into Majors('MajorType', 'MajorTitle') values ('FAS', 'Computer Science')"); mysql_query($con,"INSERT into Majors('MajorType', 'MajorTitle') values ('FAS', 'Physics')"); mysql_query($con,"INSERT into Majors('MajorType', 'MajorTitle') values ('FAAT', 'Electronics')"); echo "<script>alert('The webApp has been installed successfully')</script> "; mysql_close();}}?>
×
×
  • Create New...