-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
SQL Unknown column 'title' in 'field list'
Muddy_Funster replied to iRoot121's topic in PHP Coding Help
echo out $query_update as part of the or die statement and post up the contents -
still need more info on the file structure....
-
Retrieve table data based on a single variable
Muddy_Funster replied to jonnyfortis's topic in PHP Coding Help
could you show some sample output? maybe a relevent section of the rendered pages source code as well? -
Seriously? The line "XMLReader::open(): Unable to open source data" is there to to tell that the file is either not where you are teilling the script it is, does not exist at all, or does not have sufficient permissions set for the script to open it for reading. If the script can't open the file it's never going to manage to read it - hence the second warning message. Without information on your file structure that's all I got.
-
processing separate form inside while loop with unique submit form
Muddy_Funster replied to Bhudda's topic in PHP Coding Help
I'm not seeing any code that would fire on the Like buttons submit action. Also, to make this work, you need to have the unique identifier of the post that you are applying the like to in orfer to use it to set which post is being liked. The system you are using has some serious flwas - not least of which is no persistance regarding whether the user has liked that post already or not - you could end up with 20 users and a post that has a few million likes.... Having looked at your code, I'm a bit nervous about your db design - could you post up your table structure as well?- 1 reply
-
- form
- unique submit
-
(and 3 more)
Tagged with:
-
Execute PHP without leaving page (Contact form)
Muddy_Funster replied to rec0il's topic in PHP Coding Help
yeah, that white page meens that PHP has hit a parse error and error reporting / display errors is not set to show this on the screen. For development always set error_reporting to E_ALL and display_errors to on. I have it set in the ini file on my development server, so I'm not sure on the runtime config, but I think sticking this at the top of the page, just under the first <?php should do it. error_reporting('E_ALL'); display_errors = 1; -
Need help with simple jquery not working
Muddy_Funster replied to smarty_470's topic in Javascript Help
not seeing where tht script is loading any content, or indeed where any PHP is... -
Need help with simple jquery not working
Muddy_Funster replied to smarty_470's topic in Javascript Help
are you atempting to load files across different domains using javascript? -
so your new code is? And your regex is doing?
-
Execute PHP without leaving page (Contact form)
Muddy_Funster replied to rec0il's topic in PHP Coding Help
AJAX can do it without a page change, but you would still need to add some form of output on the contact.php page for the AJAX to work with. It also meens you will need to learn the javascript (and prefferably JQuery) for processing AJJAX requests and responces on top of the PHP. Just to check, contact.php is showing as a blank page? Neither the success or the failure message are being displayed? -
What is your regex doing? and you do know that $0 is NOT a valid variable name?
-
trying to retrieve a dropdown value and id
Muddy_Funster replied to alanl1's topic in PHP Coding Help
in your code $numcolumns should contain your ID value -
Execute PHP without leaving page (Contact form)
Muddy_Funster replied to rec0il's topic in PHP Coding Help
Choices - in ascending order of work and complexity: have your contact.php echo out the success message on success with link and stuff have contact.php redirect to whatever page you like on success copy the contents of one page into the other page and have the PHP parser check if the form has been submitted and perform action depending on result of check -
PHP/MySQL INSERT INTO Multiple Tables from Basic Form
Muddy_Funster replied to kanoy83's topic in PHP Coding Help
*cough* *cough* Triggers *cough* *cough*- 3 replies
-
- insert into
- phpmysql
-
(and 1 more)
Tagged with:
-
PHP AJAX SQL update not working after adding extra record
Muddy_Funster replied to underlink's topic in PHP Coding Help
...Did you just call me a girl? -
echoing each column from table twice problem
Muddy_Funster replied to Juarez's topic in PHP Coding Help
sqlsrv_fetch_array returns two records per result line (as does mysql_fetch_array) - one with a numerical key and the other with an assoicative one, thus your wto reults being displayed. apply the fetch type operator to the function to fix this: while( $row = sqlsrv_fetch_array( $result, SQLSRV_FETCH_ASSOC)) -
PHP AJAX SQL update not working after adding extra record
Muddy_Funster replied to underlink's topic in PHP Coding Help
what's the game plan here? you want to populate the select box with....what? coming from where? in what format? -
Handling my connection variable for login script use
Muddy_Funster replied to Apeshape's topic in PHP Coding Help
hmm, yeah I'm not sure your doing this right at all. I havn't used mysqli - I skipped from mysql to PDO - so I'll probably get some of the mysqli stuff wrong, but the class you have made could be completly rebuilt. Something more like the following I think would work: <?php class dbhandle{ public $res; private $host = "<hostname>"; private $user = "<username>"; private $pass = "<password>"; public $db; public function __construct($database){ $this->db = $database; establishConn(); } private function establishConn(){ //you'll want some error capture in here at some point $con = mysqli_connect($this->host, $this->user, $this->pass, $this->db); $this->res = $con; } } //you would then use it in the following manner: $conn = new dbhandle('myDatabaseName'); mysqli_real_escape_string($conn->res, "some string or other"); ?> -
you will need to leave that in in order to have accurate hyperlinks - www. is a subdomain - it is not nesceseraly the same site as http:// which is very different from https:// you can't normalise a dataset when each entry actualy represents a different value
-
Handling my connection variable for login script use
Muddy_Funster replied to Apeshape's topic in PHP Coding Help
post your full class and I'll have a look -
Handling my connection variable for login script use
Muddy_Funster replied to Apeshape's topic in PHP Coding Help
if your programming OOP, why are you not just using the PDO abstraction? -
you are runbning a query within a loop - don't do that. Learn how to join tables and your problems (this one at least) will go away.
-
Just out of curiosity - what is the str_replace for? Here is a heavily commented basic example of itterating through a multi-dim' array, maybe it will healp you get the idea of what to do: <?php //$myArray is a pretend array containing keys of userID's and each of these keys relates to a sub array containing keys of firstname, lastname, age, dob and homepage //I will apply only the most basic of html table formating as well as a simple hyperlink for the homepage // //lets get started echo "<table>"; //start the table element foreach($myArray as $topKey=>$subArray){ //This is the ittertation through the top level array, breaking it into key=>value pairs identified by the variables used after the "as" echo "<tr><th>user ID : $topKey </th>"; //create a new table row and echo out the userID [which is the key in the top level of $myArray, and as such is assigned to $topKey by the foreach] into a table header foreach($subArray as $arrayElems){ // This starts itterating through the sub array associated with the key we just echo'd. //notice that as we don't care about accessing the litteral key, only it's associated value, we have assigned only a single variable after the "as" this time. echo "<td>First Name : {$arrayElems['fistname']}</td>"; //echo out the firstname value into the table echo "<td>Last Name : {$arrayElems['lastname']}</td>"; //echo out the lastname value into the table echo "<td>Age : {$arrayElems['age']}</td>"; //echo out the age value into the table echo "<td>Date Of Birth : {$arrayElems['dob']}</td>"; //echo out the dob value into the table echo "<td>Homepage : <a href=\"{$arrayElems['homepage']}\">{$arrayElems['homepage']}</a></td>"; //echo out the homepage value into the table and crate a hyperlink with it too } //close sub level itteraton action block echo "</tr>" //now we are back out to the top level itteration we want to close the table row ready for the next item } //close top level itteration action block echo "</table>"; // at this point all the information has been echoe'd, so it's time to close the table ?>
-
if you are willing to pay for it, post in the freelance section and one of the more than capable people here will do it for you in a snap. If you want to learn then you will need to ask some more specific questions.