Jump to content

moisesbr

Members
  • Posts

    54
  • Joined

  • Last visited

moisesbr's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi I inserted javascript to track google ad conversions inside finalpage.htm which is parte of a major site I which I don’t have access to. The site manager only allows uploading some .htm pages for customization purposes. But the scripts are not running anymore. When I use google label checker plugin to analyse the page, I got the message below: <script> tag must not be included in a <span> But the finalpage.htm is a blank page, so there is not <span> Maybe <span> are coming from a higher level of the website. Is there I way to prevent this and guarantee my seeing as a real blank page ? Moises
  2. Hi I am a starter PHP programmer and able to build basic structures to access mySql database. Now I have a folder named “database” in my C: disk, and it belongs to a Java software . Below are some files inside the folder: derby.log, c1a1.dat, c1b1.dat, c1c0.dat… etc I would like to know if it’s possible to access it using php, and the command I can use to connect to it, something as I do to acess my MySql database. Also if it's possible, and how to view its tables in PHPMyAdmin. Moises
  3. I don't think so. I have to go through the table looking for sent = 0 condition and executing a code at every row where sent = 0 and replacing sent with 1.
  4. Hi I have a email table (to, email, subject , ect.) and already have the php code to send may from a record of the table. Now I need a way to scan the table and execute my code to build email from each row of the table. Something as : Scan table email where sent = 0 Is there any hint about this issue ? Moises
  5. Hi The code below is not working. sendMail($to,$name, $subject, $from, $message); All variables tested just below the line with echo command. I see no reason for it not to work. I have more of this code in other parts of the .php and works fine. No error message at page running. It there a way to track this line of code to see details of what is happening to it ? Moises
  6. I will try the solution below. return preg_match_all( "/[0-9]/", $str ); and will let you know if I cannot achieve it. Moises
  7. Hi I need to program as follow: If a variable contains more than 3 numbers (as ACD 9455) say "too many numbers" If a variable has no number (as ACD JK) say "no number" Moises
  8. Hi I would like to increment chave Nei column with +1 in table controle, every time an event happens. I tryied command below but it results error: result = mysql_query("UPDATE controle set chave_nei= chave_nei + 1") ; Moises
  9. How can I increment + 1 to a column in a table, using update mysql command ? Moises
  10. How can I use update mysql command to add + 1 to a numeric field of a table ? I would like to increment the column "count" +1 every time I execute it. Moises
  11. Below is the code is the code I am trying. It calls dbase_open() function, but problem is enabling this function. /* * Part 2 code modified by Clint Christopher Canada from different public domain sources * Part 1 code created by Clint Christopher Canada. BSD licensed. */ // This is Part I of the code $tbl = "table to create"; $db_uname = 'mysql username'; $db_passwd = 'mysql password'; $db = 'database'; $conn = mysql_pconnect('localhost',$db_uname, $db_passwd); // Path to dbase file $db_path = ".DBF"; // Open dbase file $dbh = dbase_open($db_path, 0) or die("Error! Could not open dbase database file '$db_path'."); // Get column information $column_info = dbase_get_header_info($dbh); // Display information //print_r($column_info); $line = array(); foreach($column_info as $col) { switch($col['type']) { case 'character': $line[]= "`$col[name]` VARCHAR( $col[length] )"; break; case 'number': $line[]= "`$col[name]` FLOAT"; break; case 'boolean': $line[]= "`$col[name]` BOOL"; break; case 'date': $line[]= "`$col[name]` DATE"; break; case 'memo': $line[]= "`$col[name]` TEXT"; break; } } $str = implode(",",$line); $sql = "CREATE TABLE `$tbl` ( $str );"; mysql_select_db($db,$conn); mysql_query($sql,$conn); set_time_limit(0); // I added unlimited time limit here, because the records I imported were in the hundreds of thousands. // This is part 2 of the code import_dbf($db, $tbl, $db_path); function import_dbf($db, $table, $dbf_file) { global $conn; if (!$dbf = dbase_open ($dbf_file, 0)){ die("Could not open $dbf_file for import."); } $num_rec = dbase_numrecords($dbf); $num_fields = dbase_numfields($dbf); $fields = array(); for ($i=1; $i<=$num_rec; $i++){ $row = @dbase_get_record_with_names($dbf,$i); $q = "insert into $db.$table values ("; foreach ($row as $key => $val){ if ($key == 'deleted'){ continue; } $q .= "'" . addslashes(trim($val)) . "',"; // Code modified to trim out whitespaces } if (isset($extra_col_val)){ $q .= "'$extra_col_val',"; } $q = substr($q, 0, -1); $q .= ')'; //if the query failed - go ahead and print a bunch of debug info if (!$result = mysql_query($q, $conn)){ print (mysql_error() . " SQL: $q \n"); print (substr_count($q, ',') + 1) . " Fields total. "; $problem_q = explode(',', $q); $q1 = "desc $db.$table"; $result1 = mysql_query($q1, $conn); $columns = array(); $i = 1; while ($row1 = mysql_fetch_assoc($result1)){ $columns[$i] = $row1['Field']; $i++; } $i = 1; foreach ($problem_q as $pq){ print "$i column: {$columns[$i]} data: $pq \n"; $i++; } die(); } } } ?>
  12. I got it somewhere over the net, and maybe this is the problem. Don't you know if there are a full package to install support for dbase_open() function, rather than pure dll copy ?
  13. Hi I want to import .dbf files (Visual Foxpro) to mysql database. I am running tests in windows 7 , 64bit. Moises
  14. saved it aso to /ext, reloaded php, but I have message: Unable to load dinamic library ... ext/php_dabase.dll %1 It is not a valid win 32
  15. Hi I am getting error: Fatal error: Call to undefined function dbase_open() in C:\wamp\www\test\import.php on line 20 Then I downloade and saved php_dbase. dll And line in php ini: extension=php_dbase.dll, but still getting error. All in folder: C:\wamp\bin\php\php5.4.12 Is it enough ?
×
×
  • 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.