Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=335669.0
  2. Not sure what tally or dx-fusion is but after a quick google I found this http://www.dx-fusion.com/2010/10/how-to-transfer-tally-data-into-mysql.html Does that help?
  3. Either use single quotes wrapped around the double quores $queryline = str_replace('"','""',$line); OR escape the double quotes $queryline = str_replace("\"","\"\"",$line);
  4. This is what I did to enable the advanced features (using the latest version 3.4.x) First login to phpmyadmin and create a new database called phpmadmin. When you have created the database select the import tab at the top of the page. Click the Browse/Choose file button and navigate to your phpmyadmin folder and open the scripts directory and select the create_tables.sql file. Click open to close the window. Then press Go (bottom of page). The database for the control user has been setup. Next to setup the control user. Go to the phpmyadmin home screen and click the privileges tab. Click the add a new user link. For the username type phpmyadmin. Set anything as the password (Make sure you remember it). Choose the option to Create database with same name and grant all privileges And then click the Go button. You have now setup the control user and the database for phpmyadmin. You now need to configure phpmyadmin. Open the config file (called config.inc.php). And remove the // from the start of the following lines /* User used to manipulate with storage */ // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; /* Storage database and tables */ // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // $cfg['Servers'][$i]['relation'] = 'pma_relation'; // $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; // $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; Make sure you set $cfg['Servers'][$i]['controluser'] to phpmyadmin and apply the password to $cfg['Servers'][$i]['controlpass']. Log out of phpmyadmin, then log back in (not as the control user). The advanced features should now be enabled.
  5. What type of database are you using. Your code starts of with using odbc functions, then at the end of the script your using mysql functions (which are for use with MySQL databases only). These functions are not compatible with each other.
  6. You wouldn't use ucwords on the $query variable. You'll need to use it on the specific $nt variable. I'm guessing here? echo "<a href='" . str_replace(' ','_',$nt[$i]) . ".php?title=$title&subtype=$FileUsed'>" . ucwords($nt[$i]) . "</a>" . "<br/>";
  7. What does that mean? What are you trying to do?
  8. Oh.. I didn't realise xyph had replied. Must of posted as I was typing my reply.
  9. You're not setting the width and height properties within the set_size method correctly function set_size($w= 0, $h = 0) { $this->$width = $w; $this->$height = $h; } You should be using $this->width and $this->height not $this->$width and $this->$height Another issue you have is on this line return ($this->width * $this-height); You have left of the > after $this-
  10. To enable these advanced features read the manual.
  11. The mysql_fetch_* functions return one row at a time. As your query will return more than two rows you'll need to use these functions with a while loop to get all the results $result = mysql_query("SELECT pagename FROM tablename WHERE user = 'user1'") or die(mysql_error(); // definee userPages as an array. We'll add the userpages to this array latter $userPages = array(); // loop through the results, one row at a time while($row = mysql_fetch_assoc($result)) { // add the pagename to userPages array $userPages[] = $row['pagename']; } // output the the userPages array echo '<pre>' . print_r($userPages, true) . '</pre>';
  12. You're most probably getting 0.11 as the bid rather than 0.10 because you're adding 0.01 in the highlighted code below If the bid is 0.01 to 0.10 that for loop will always return 0.11. If you take out the highlighted code above it'll return 0.10 as the bid.
  13. Because $matches contains an array of fields, not an array of results!
  14. You'd loop through the specs array. Example foreach($array_of_specs as $specs) { echo $specs->spec_name . '<br />'; }
  15. Is there more code to this? Is that code part of another loop which is why your getting duplicated results.
  16. You cannot dump html code within PHP code and expect your script to just work.
  17. use array_map If you want apply trim() to all values within $_POST['register']; $register = array_map('trim', $_POST['register']);
  18. An alternative way would be take each line within your string and add it into an array. You'd then iterate over the lines within the array searching for the string. When the string is found return the current line. Example code // the string to search for $searchString = 'mystring'; // some example data to work with $data = 'Line 1 Line 2 mystring Line 3 Line 4'; // add each line into the array $lines $lines = explode("\n", $data); // iterate through the lines foreach($lines as $key => $line) { // check to see if the string is on the current line if(strpos($line, $searchString) !== FALSE) { // string has been found, tell the user on what line it is on echo "Found '$searchString' on Line " . ($key+1); break; // stop the loop } }
  19. The \n escape character represents newlines. To get the number of lines you can do $count = substr_count($string, "\n");
  20. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=335265.0
  21. This topic is over 2 years old.
  22. This line $link = mysql_connect(host, username, password); Should be $this->link = mysql_connect(host, username, password); This $this->connect_DB($this->link = $link) Should be $this->connect_DB($this->link)
  23. You can add up the field within your SQL query. An Example query SELECT (col1 + col2 + col3) AS total FROM table
  24. Not quite if(!$result) { echo 'error'; } else { // check that a record was deleted if(mysql_affected_rows() == 1) { echo 'Query deleted the record ' . $tID . ' successfully'; } // record was not deleted else { echo 'The query did not delete the record' . $tID; } } That does need even relate to the OP's code.
  25. Use htmlentities with the ENT_QUOTES flag when adding the code to the database. When you get it out of the database use html_entity_decode with the ENT_QUOTES flag (if you need that code to render the flash object on the page).
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.