![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
wildteen88
-
Posts
10,480 -
Joined
-
Last visited
Never
Posts posted by wildteen88
-
-
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?
-
How do you use a double quote in str_replace?
$queryline = str_replace(""","'""",$line);
Either use single quotes wrapped around the double quores
$queryline = str_replace('"','""',$line);
OR escape the double quotes
$queryline = str_replace("\"","\"\"",$line);
-
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.
-
2
-
-
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.
-
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/>";
-
I would like PHP to look at each address and handle it,
What does that mean? What are you trying to do?
-
xyph pointed these exact issues out wildteen...
Oh.. I didn't realise xyph had replied. Must of posted as I was typing my reply.
-
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-
-
To enable these advanced features read the manual.
-
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>';
-
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
for($j=$_POST['bid_from'];$j<($_POST['bid_to']+0.01);$j+=0.01)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.
-
Because $matches contains an array of fields, not an array of results!
-
You'd loop through the specs array. Example
foreach($array_of_specs as $specs) { echo $specs->spec_name . '<br />'; }
-
Is there more code to this? Is that code part of another loop which is why your getting duplicated results.
-
You cannot dump html code within PHP code and expect your script to just work.
-
use array_map If you want apply trim() to all values within $_POST['register'];
$register = array_map('trim', $_POST['register']);
-
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 } }
-
The \n escape character represents newlines. To get the number of lines you can do
$count = substr_count($string, "\n");
-
This topic has been moved to JavaScript Help.
-
Instead of unset($_COOKIE['varname'])
try
unset($_SESSION['varname']);
This topic is over 2 years old.
-
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)
-
You can add up the field within your SQL query. An Example query
SELECT (col1 + col2 + col3) AS total FROM table
-
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; } }
if(mysql_query($result,$conn)){echo "$i encountered an error.<br/>";
} else {
echo "$i successfully inserted.<br/>";
}
That does need even relate to the OP's code.
-
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).
MOVED: tally to mysql using php
in PHP Coding Help
Posted
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=335669.0