moisesbr
-
Posts
54 -
Joined
-
Last visited
Posts posted by moisesbr
-
-
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 -
Your talking about a pretty simple SQL query.
SELECT email FROM tbl WHERE sent = 0;
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.
-
HiI 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 = 0Is there any hint about this issue ?Moises
-
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 -
I will try the solution below.
return preg_match_all( "/[0-9]/", $str );
and will let you know if I cannot achieve it.
Moises
-
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
-
HiI 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
-
How can I increment + 1 to a column in a table, using update mysql command ?
Moises
-
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
-
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 codeimport_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 infoif (!$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();}}}?>
-
the php_dbase.dll file must be compiled for the same version and thread-safe or non-thread-safe flavor of php that you are using. where did you get this php_dbase.dll file at?
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 ?
-
Hi
I want to import .dbf files (Visual Foxpro) to mysql database.
I am running tests in windows 7 , 64bit.Moises
-
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
-
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. dllAnd 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 ?
-
Hi
How can I get a piece of a variable ?
From: aaaaaaab1234567 , get ab1234 ?Moisés
-
In have dates in format below (char type).
Thu Mar 17 11:07:04 2011
Is possible to transform it to datetime to insert in mysql table ?
Moises
-
SELECT * FROM certificado WHERE nome LIKE '%{$name}%'
Very useful command, but if name is Elton John, and I search "John", Elton John is found as well.
I need Elton John is found only if a type: "Elto" "Elton" "Elton J", etc.
Moises
-
Hi
I trying the search using the query below:
$result = mysql_query("SELECT * FROM certificado WHERE nome='$name' ") or die (mysql_error());If I look for Jose da Silva in table,it only works if I type full name. "Jose da Silva" .
How can I make the query work by typing part of search string, as "Jose da", "Jose d", etc.Moises
-
HiUser may insert numbers as:00000000000454549800000003585498No matter what he types, I need always remove zero from leftside of variables. (char type)Is there a ready function for this, ou how can I do it ?Moises
-
Hi
I have a database where some students don't have their Identity_number stored , but all students have a code.
I am trying to implement a search in this database with some degree of safety.
In first html page, both fields are mandatory (because everbody has an Identity_number to type )
$result = mysql_query("SELECT * FROM certificado WHERE Identity_number= '$cpf'") or die (mysql_error());
If found Identity_number, compare certificado.code with $code and show (html result - a already have) if match.
However if Identity_number is not found, then search only by code. ( because nobody will guess student does not have Identity_number in database .)Is it easy to do such a code ? I need help at least with $result mysql lines.
Moises
-
What's the collation of the field you're searching on? If you don't know, what does SHOW CREATE TABLE output for it?
Hi
It's:
utf8_general_cl
-
Hi
How to ignore upper/lower case why searching ?
e.g.: Locate a name in database where search term = two first letters of string
"MA" results Mark ou mark
or "ma" results Mark ou mark
Also, do I need to trim A string as in some languages if user mistype a space: " MA"
Moises
-
Hi
Anybody using Netbeans to generate php pages ?
I am trying netbeans to generate code and noticed it adds /* and * all over the code in the code.
Why is it for and is there a way to remove it ?
Moises -
Hi
I have a retangular button in HTML code inside .php page.
I would like a example on how to add round borders format to it and if possible change color when passing mouse over it.<input type="submit" value="Confirmar pedido" name="B1" style="border:1px outset #339933; color: #FFFFFF; font-family: Arial; font-weight: bold; background-color:#339933; font-size:12pt">
Moises
Java script not running
in Javascript Help
Posted
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