-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
really? what don't you understand about it?
-
ok, could you give a more accurate description of what exactly you are trying to return?
-
use conditional logic on the display code. $checkMe = ""; while(...){ if ($field['returned'] != $checkMe){ //check if the value of the field is new $checkMe = $field['returned']; // if it is set it as the value to check the next field against echo "<td>$checkMe</td>"; // and display the new value } else{ echo "<td> </td>"; // if the value is not new only display blank space } //...rest of code inside while loop }
-
From what I can work out you are looking for something like this: SELECT clients.name, clients.amount, users.name, MAX(payments.paydate) as lastPay, SUM(payments.amount) as paysum FROM users LEFT JOIN clients ON (clients.consultantid = users.id) LEFT JOIN payments ON (clients.id = payments.clientid) WHERE payments.payed = 1 GROUP BY clients.id ORDER BY lastPay You will probably need to tweek the joins and fields selected at best but it should be enough to get you going.
-
ok, running loops inside other loops is, of course, fine. However, running queries inside of loops is really not. You can get all the information from a single query and then use conditional logic to display it the way you want. I recomend revising your whole fetch code to use only a single query.
-
I know this is going to sound old hat, patronising and all the rest of it, and since you know a shed load more about this stuff than I do it's the best I got at the moment. Have you tried replacing the * with field names in your cross join subquery? I know, I know, but you've help me that much in the past I wouldn't feel right if I didn't at least try
-
Does changing your last LEFT JOIN to an INNER JOIN help?
-
as you are using three completly unrelated tables the best thing to do would be to build a variable that stores your option list (dropdown box) at the start, and then echo that variable for each of the fields. I'm having a hard time seing the point to this, but your likely going to need at least 1 counter within one of your loops in order to refference either the rows or columns that you have in the table so that you can apply that to the number of times accross or down you need to fill in the option list, depending on which loop you don't include the option list echo code in. I'm sure there has to be a better way of achieving what you are looking for as the end result. If your up for some rediesign post up your remit for this task and well have a look at alternatives.
-
PHP Directory Delete and MySql Row delete Help Please
Muddy_Funster replied to Ult1matek1ll's topic in PHP Coding Help
I see the code. I see the delete script. I don't see where you tell us what the problem actualy is. -
You are using the $_SESSION['emp_name'] session variable in the form to display the value, but no where in your code do you assign a value to this variable.... also you are using the POST method in your form, and the GET method in your code.... and you have duplicate code for the GET check....
-
Use JOINS over subqueries.
-
We would need to see the class that you are using for the imap connection to offer any practical help on that.
-
use echo to build the table and headings before you run the while loop, then during the loop echo the results into the table: echo "<table> <tr><th>Comppany Name</th><th>Location</th><th>Postcode</th><th>Basic Members</th><th>Upgraded Users</th><th>Company Logo</th></tr> <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>"; // store the records into $row array and loop through while ( $row = mysql_fetch_array( $result, MYSQL_ASSOC ) ) { // Print out the contents of the entry echo "<tr><td>{$row['company_name']}</td>"; echo "<td>{$row['location']}</td>"; echo "<td>{$row['postcode']}</td>"; echo "<td>{$row['basicpackage_description']}</td>"; echo "<td>{$row['premiumuser_description']}</td>"; echo "<td>{$row['upload']}</td>"; echo "<td><img src=\"http://www.removalspace.com/images/COMPANIES{$row['upload']}\" alt=\"logo\" /></td></tr>"; } echo "</table>";
-
you havn't really given us much to work with. Does mail() work at all form your site? have you tried assigning (join(', ', $destination) to a variable and then echoing it to make sure that the content is accurate? have you tried capturing any failure of mail() in that script?
-
I was taking from the OP that there wasn't a form per-say, just a single field to paste the clipboard info into.
-
it's not the ideal way of doing it, but you could use: $array= array(); $string = trim($_POST['yourTextbox']); $array = explode(":", $string); $query = "INSERT INTO table (fist, last, address, telephone) VALUES ('{$array[1]}', '{$array[3]}', '{$array[5]}', '{$array[7]}')"; mysql_query($query) or die ("Something went badly wrong!<BR><BR>".mysql_error());
-
if (mysql_num_rows($sql1) == 0){ echo "you have no appointments in the next 7 days. Thank you for checking with us."; } else{ //produce email }
-
change this while ($row = mysqli_fetch_assoc($sql)) { to while ($row = mysqli_fetch_assoc($sql1)) { you are using the wrong variable in your fetch, I suggest using more relative variable names to avoid this issue in the future. Also, checking mysql_num_rows($sql1) will allow you to check for no appointments and handle that accordingly.
-
If you don't want to learn PHP then you are posing in the wrong forum section. As for 3rd party programs, you would need to provide information about what your server is capable of running, as well as how you would be planning to store your download count.
-
do you get any errors? what is your code if the file does not match your if statement? have you checked that the file is on the server and is in the right folder? is your code for displaying the image accurate including case used in file and folder names?
-
would need to see your table design (prefferably with a couple of lines of sample data too)
-
depends what methods you are calling in your get_results object. can we see the contents of that?
-
looks like the only place the comment is going to come from is the texbox on the form. so there is no point in trying to select it from the student table. It may be time to take a step back and have a deap breath, then come at it again from the ground up.
-
website using php and mysql with facebook
Muddy_Funster replied to steven_elvisda's topic in PHP Coding Help
you will need to get the facebook API and use that. -
could you post the code for function_get_content()?