Search Results

Search found 2 results on 1 pages for 'user1020069'.

Page 1/1 | 1 

  • CSV file read fail (PHP )

    - by user1020069
    I am trying to read a csv file (delimited by commas) but unfortunately, it isn't responding as it ought to. I am not so sure what I am doing wrong here, but I'll paste out the contents of the code and the CSV file both : $row = 0; if($handle = fopen("SampleQuizData.csv","r") !== FALSE) { // WORKS UNTIL HERE, SO FILE IS BEING READ while(!feof(handle)){ $line = fgetcsv($handle, 1024, ",") ; echo $line[2]; // DOES NOT WORK } } And the CSV file is (the emails and names have been changed here to protect the identities of the users) parijat,something,[email protected] matthew,durp, [email protected] steve,vai,[email protected] rajni,kanth,[email protected]

    Read the article

  • Confusion using MYSQLI

    - by user1020069
    I just started using mysqli API for PHP. Apparently, every time an object of the class MYSQLI is instantiated, it can setup a connection to the database as it connects to the server unlike mysql_connect, which connects to the server first and then you are required to specify the database to query. Now this is a good problem if the db exists, in my case, the db does not exist on the first ever connection to the server/execution of the problem, hence I must connect without specifying the database, which is fine, since the msyqli constructor does not make this database mandatory. My challenge is essentially, how do I check if the database exists before attempting the first connection. The only way to really do this would be to establish a conection to the server and then use the result of the following query to gauge if the database exists: SELECT COUNT(*) AS `exists` FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMATA.SCHEMA_NAME="dbname" ; If this returns true, then the database exists, but now the challenge is how do I get the mysqli object to query this database rather than having to prefix the name of the database in the query. Thanks much

    Read the article

1