
mallard
Members-
Posts
21 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
mallard's Achievements

Newbie (1/5)
0
Reputation
-
Call to a member function stmt_init() on a non-object
mallard replied to jeppers's topic in PHP Coding Help
Very cool. Thanks for your help, PFMaBiSmAd. And thanks for clearly explaining this. Hopefully the OP will come back and see this. Your solution works. I can successfully register a user and add them to a database. So, here's what I did. I changed the last IF statement in the dbConnect function to this: if ($connectionType == 'mysqli') { return new mysqli($host, $user, $pwd, $db); } elseif ($mysqli->connect_error) { die('Connect Error: ' . $mysqli->connect_error); } -
Call to a member function stmt_init() on a non-object
mallard replied to jeppers's topic in PHP Coding Help
I just found this thread from a search. I'm using the same book as the OP and I'm having the same exact problem. Using the same exact code. Does anybody know what the fix for this might be? If $conn returns boolean true is that why we get the error "Fatal error: Call to a member function stmt_init() on a non-object"? What type of result should $conn return so that this error won't get thrown when we use the stmt_init() function? Thanks for any follow up! -
Well, I asked a friend who designed a Flash site to suggest some books and he mentioned the Flash Bible and the Flash ActionScript Bible. I actually have Macromedia Flash MX so I ordered these books from sellers on Amazon: Macromedia Flash MX 2004 Hands-On Training Macromedia Flash MX 2004 Bible Macromedia Flash MX 2004 ActionScript Bible Got 'em all for 30 bucks including shipping. This should get me started.
-
I would like to learn how to use FLASH this summer to build a photography web site. I’m looking for recommendations for a good book or two to help me start to achieve this. I have experience with HTML, JavaScript and PHP but I have no experience with FLASH. So I may need to start with an introductory type of book as well as a more advanced one. Thanks for any suggestions!
-
Thanks for your help, guys. I loaded phpMyAdmin on the server and it seems that there is no MySQL access. I've decided to ask my ISP about the details of using MySQL as you've suggested. I'll report back with my resolution. Thanks!
-
I’m new to MySQL. I run my web site on free space supplied by my ISP. I’m trying to learn how to use MySQL databases. I’m not sure if MySQL is installed on my ISP’s server. I ran a phpinfo script which shows the version number as well as all of the following information for MySQL on the server: mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.0.14 MYSQL_MODULE_TYPE none MYSQL_SOCKET /tmp/mysql.sock MYSQL_INCLUDE no value MYSQL_LIBS no value Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off Does this mean that it IS installed? If so then how do I “start” mysql from a DOS prompt? I normally log into my ISP’s server via DOS using ftp -i ftp#.ispname.net to upload files for my web site. How do you get into MySQL once you log into a server in this way? Or do you access MySQL in some other way? Thanks for any help! I’m really new to this stuff…
-
Oh my God... I found my mistake. I was placing the loop before a closing brace "}" in the script. I moved it outside of the brace and the problem was resolved. That's all it was. I'd like to think that you helped me get there though. And you showed me a different way to bust a foreach loop. Thanks again!
-
So then there's something else in the script that's jacking the output for me. I don't even wanna get into that. But thanks for helping me!
-
Cool, thanks!
-
I just tried your first example and I got the same pyramid output. There must be something else somewhere in the script that's causing this. What I don't get is when I do the print_r on the array the output is normal but when I try to loop it with a foreach I get that pyramid output.
-
Here's a small chunk of the output when I do a print_r on the array that I'm working with... Array ( [black_Crowes-Thorn_in_My_Pride-The_Southern_Harmony_and_Musical_Companion.ptb] => Array ( [0] => ptab [1] => Thorn in My Pride [2] => The Black Crowes [3] => The Southern Harmony And Musical Companion ) [Guns_N_Roses-November_Rain-Use_Your_Illusion_I.ptb] => Array ( [0] => ptab [1] => November Rain Solo [2] => Guns N' Roses [3] => Use Your Illusion I ) [Guns_N_Roses-Sweet_Child_O_Mine_Solo-Appetite_for_Distruction.ptb] => Array ( [0] => ptab [1] => Sweet Child O' Mine Solo [2] => Guns N' Roses [3] => Appetite For Distruction ) )
-
Nice. Thank you for your quick response. I just plugged in the implode bit that you posted there but it did the same thing that my current foreach loop is doing. The output looks like this (I'm substituting integers to represent the key and value for the entire array for each file to keep it simple: 1 12 123 1234 12345 etc... Kind of like a pyramid. I want the output to be: 1 2 3 4 5 etc... I'm sure that there's an easy fix for this. I'm probably just making a common mistake.
-
I need help writing a basic foreach loop. Say I have this data: ( [file1.ext] => Array ( [0] => element0 [1] => element1 [2] => element2 [3] => element3 ) [file2.ext] => Array ( [0] => element0 [1] => element1 [2] => element2 [3] => element3 ) [file3.ext] => Array ( [0] => element0 [1] => element1 [2] => element2 [3] => element3 ) ) I want to write a foreach loop so that the output will be: file1.ext element1 element2 element3 file2.ext element1 element2 element3 file3.ext element1 element2 element3 Thanks for any help!
-
[SOLVED] how to print or echo data using custom function
mallard replied to mallard's topic in PHP Coding Help
Hmm... I've tried that and it doesn't display anything on the screen. Unless I'm not putting the right thing inside the parenthesis. It's a shame that I can't figure this out 'cause the function is extracting the exact data that I want. I just don't understand how to print it out to the screen and work with it so like each file will be on a new line and even sort the data and stuff. Any other thoughts? -
[SOLVED] how to print or echo data using custom function
mallard replied to mallard's topic in PHP Coding Help
Okay... here's the whole script that I'm using: <?php function dataArray($sz_pathToFiles) { $ar_seq = array(255,255,1,0,7,0); $ar_tabFiles = array(); $b_lastWasNewline = false; $b_seqActive = false; if(preg_match('/\/$/',$sz_pathToFiles) == 0) { $sz_pathToFiles .= "/"; } foreach(glob($sz_pathToFiles . "tabs/*.ext") as $file) { $n = 0; $b_found = false; $b_lastWasNewline = false; $sz_out = ""; $n_found = -1; $n_seqCount = 0; $n_char = 0; $n_linesExtracted = 0; $ar_tabFiles[basename($file)] = array(); $fileData = file_get_contents($file); $fileData = bin2hex($fileData); while($n < strlen($fileData) && !$b_found && $n_linesExtracted < 4) { $n_char = substr($fileData,$n,2); $n_char = base_convert($n_char,16,10); if($n_char > 31 && $n_char < 127) { if($b_lastWasNewline && ( preg_match('/[a-zA-Z0-9]/',chr($n_char)) == 0 ) ) { $b_lastWasNewline = false; } else { $sz_out .= chr($n_char); $b_lastWasNewline = false; } } else { if(!$b_lastWasNewline) { $ar_tabFiles[basename($file)][$n_linesExtracted] = $sz_out; $sz_out = ""; $b_lastWasNewline = true; ++$n_linesExtracted; } } if($n_char == $ar_seq[$n_seqCount]) { $n_seqCount += 1; $b_seqActive = true; } elseif($b_seqActive) { $n_seqCount = 0; $b_seqActive = false; } $n += 2; if($n_seqCount == sizeof($ar_seq)) { $b_found = true; } } } return $ar_tabFiles; } print_r(dataArray('./')); ?> When I do that print_r I see all of the arrays of stuff that I want but I don't understand how to echo or print the stuff from that function dataArray. Like, is there way to echo the array content out individually so that I can sort it out in a table?