PHP Nubsauce
Members-
Posts
42 -
Joined
-
Last visited
Never
Everything posted by PHP Nubsauce
-
date1 and date store the date. I'm not trying to be a smart guy here but..doesen't the data convert I posted twice now tell you this? Honestly, I'm not sure. I did not write this code.
-
Okay, what exactly do you need from me to help me? :-\
-
I don't understand how I am doing things poorly, everything works mint. I see how your query would work, but whats the problem with mine.. ??? Anyways, here is my whole query <?php $links2 = @mysql_query("SELECT * FROM ".$mysql_pretext."_calendar "); if (!$links2) { echo("Error retrieving calendar from the database!<br>Error: " . mysql_error()); exit(); } while ($link = mysql_fetch_array($links2)) { $id = $link["ID"]; $title1 = $link["title"]; $date1 = $link["date"]; $date = dateconvert($date1, 2); $dateday = date('d', strtotime($date1)); $description = $link["description"]; $shortdescription = $link["short_description"]; once again, here is my data input for Date } function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($day, $month, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$month/$day/$year"; return $date; } } Month, Day, and Year are all inserted originally as raw numbers, 1 2 3 4 and so on. ??? My only issue is it pulls up all scheduled events on the calandar, rather then just the month i want to display.
-
Hey Guys, What I'm trying to do is only select scheduled events from the calandar for a certain month. <?php $links2 = @mysql_query("SELECT * FROM ".$mysql_pretext."_calendar "); How can I select only June? This is the data convert I use at the top of the page. } function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($day, $month, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$month/$day/$year"; return $date; } } any help would be much appriciated nubsauce
-
[SOLVED] Why does my code not display all my database info?
PHP Nubsauce replied to PHP Nubsauce's topic in PHP Coding Help
Thank you for the help, both of you. Both ways worked. Ray you're the man bro. -
If I close my if statement at the end, it displays all my info but with a new table for each one. If I close it like shown, it only displays one object from the database. I need all my info to be displayed in one table box. Can anybody help me please? $links = @mysql_query("SELECT * FROM ".$mysql_pretext."_documents WHERE document_type_id = '2'"); if (!$links) { echo("Error retrieving student life documents from the database!<br>Error: " . mysql_error()); exit(); } $number = 0; while ($link = mysql_fetch_array($links)) { $ids1 = $link["ID"]; $titles1 = $link["title"]; $type = $link["type"]; $date = $link["date"]; $filename = $link["name"]; $addedby = $link["added_by"]; $number++; } ?> <td height="30" colspan="2" bgcolor="#A0C4EC" class="search"><span class="style1">Student Life Library</span></td> </tr> <tr> <td width="6%" height="30" valign="middle"><img src="images/pdf_icon.png" width="20" height="20" /></td> <td width="94%" height="30" valign="middle" class="text"><a href="getdocument.php?id=<?php echo($ids1); ?>"><?php echo($filename); ?></a> - <?php echo($titles1); ?></td> </tr> <tr>
-
i figured that lemmin, as ray was posting, i was doing what u told me to do on the one of them to all of them
-
This is now fixed! Thanks all!
-
No this did not work, but thanks for trying ! php nubsauce
-
Can anybody tell me why my slideshowid isent pushing through right? It's sitting in the actual URL just fine. $query = "INSERT INTO slideshow_images (max_image_name, max_image_size, max_image_type, max_image_content, request_id, side_caption, photo_caption, for_sale, approved, slideshow_id) ". "VALUES ('$thumbfileName', '$thumbfileSize', '$thumbfileType', '$thumbcontent', '$_POST[requestid]', '$_POST[sidecaption]', '$_POST[photocaption]', '$_POST[forsale]', 'no', '$_GET[slideshowid]')"; Any help would make me jump with joy. Thanks, Nubsauce.
-
My problem is that everything works just fine, but if a referrer has no payment, he doesent show up on the referrers list. Referrers that do have payments, show up just fine. I need a referrer to show up even if they do not have a payment.. Any help would be awesome! I'm pretty sure its me closing with } at the wrong times. But if I mess with the close brackets, things get REALLY REALLY wacked out. If theres no payment, is there a way to put "None", making the referrer still show up? Thanks, Nubsauce. <span class="textDkGrayBold"><strong> <a href="add.php">Add a Referrer</a></strong></span> <br> <br> <table width="68%" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="17%" bgcolor="#66CCCC" class="bold"><strong>Name</strong></td> <td width="17%" bgcolor="#66CCCC" class="bold"><strong>Amount Due </strong></td> <td width="17%" bgcolor="#66CCCC" class="bold"><strong>Last Payment Date</strong></td> <td width="18%" bgcolor="#66CCCC" class="bold"><strong>Last Payment Amount</strong></td> <td width="18%" bgcolor="#66CCCC" class="bold"><strong>Phone</strong></td> <td width="18%" bgcolor="#66CCCC"> </td> </tr> <?php $links = @mysql_query("SELECT * FROM ".$mysql_pretext."_referrers ORDER BY company ASC"); if (!$links) { echo("Error retrieving referrers from the database!<br>Error: " . mysql_error()); exit(); } while ($link = mysql_fetch_array($links)) { $id = $link["ID"]; $firstname = $link["first_name"]; $lastname = $link["last_name"]; $email = $link["email"]; $homephone = $link["home_phone"]; $cellphone = $link["cell_phone"]; $workphone = $link["work_phone"]; ?> <?php $expectedtotal = 0; $realtotal = 0; $links34 = @mysql_query("SELECT * FROM ".$mysql_pretext."_customers WHERE referrer_id = '$id'"); if (!$links34) { echo("Error retrieving projects from the database!<br>Error: " . mysql_error()); exit(); } while ($link = mysql_fetch_array($links34)) { $customerid = $link["ID"]; $clientcompany = $link["company"]; ?> <?php $links33 = @mysql_query("SELECT * FROM ".$mysql_pretext."_customer_payments WHERE customer_id = '$customerid' ORDER BY date DESC"); if (!$links33) { echo("Error retrieving customer payments from the database!<br>Error: " . mysql_error()); exit(); } ?> <?php while ($link = mysql_fetch_array($links33)) { $customerpaymentid = $link["ID"]; $customerid = $link["customer_id"]; $amountreceived = $link["amount_received"]; $paymentdate1 = $link["date"]; $paymentdate = dateconvert($paymentdate1, 2); $realtotal = $realtotal + $amountreceived; $commissions = $amountreceived * 0.1; } ?> <?php $links47 = @mysql_query("SELECT * FROM ".$mysql_pretext."_referrer_payments WHERE referrer_id = '$id' ORDER BY date DESC LIMIT 1"); if (!$links47) { echo("Error retrieving referrer payments from the database!<br>Error: " . mysql_error()); exit(); } while ($link = mysql_fetch_array($links47)) { $paymentid = $link["ID"]; $amountpaid = $link["amount_paid"]; $paymentdate1 = $link["date"]; $paymentdate = dateconvert($paymentdate1, 2); ?> <?php $totalcommissionpaid = 0; $links11 = @mysql_query("SELECT * FROM ".$mysql_pretext."_referrer_payments WHERE referrer_id = '$id' ORDER BY date DESC"); if (!$links11) { echo("Error retrieving referrer payments from the database!<br>Error: " . mysql_error()); exit(); } while ($link = mysql_fetch_array($links11)) { $paymentid2 = $link["ID"]; $amountpaid2 = $link["amount_paid"]; $realrealtotal = $realtotal * 0.1; $realexpectedtotal = $expectedtotal * 0.1; $totalcommissionpaid = $totalcommissionpaid + $amountpaid2; $totalcommissiondue = $realrealtotal - $totalcommissionpaid; } ?> <tr> <td class="text" valign="top"><a href="referrer.php?id=<?php echo($id); ?>"><?php echo($firstname); ?> <?php echo($lastname); ?></a></td> <td class="text" valign="top">$<?php echo(number_format($totalcommissiondue,2)); ?></a></td> <td class="text" valign="top"><font color="#000000" nowrap class="text"> <?php if($paymentdate1 != '0000-00-00'){ echo($paymentdate); } else { echo('None'); } ?> </font></td> <td class="text" valign="top">$<?php echo(number_format($amountpaid, 2)); ?></td> <td class="text" valign="top"> <?php if($homephone != ''){ ?> h: <?php echo($homephone); ?><br> <?php } ?> <?php if($cellphone != ''){ ?> c: <?php echo($cellphone); ?><br> <?php } ?> <?php if($workphone != ''){ ?> w: <?php echo($workphone); ?> </td> <td valign="top" class="text"><div align="center"> <a href="addreferrerpayment.php?id=<?php echo($id); ?>">Record a Payment<br> <br> </a><a href="edit.php?id=<?php echo($id); ?>">edit</a> - <a href="<?php echo($PHP_SELF); ?>?delete=<?php echo($id); ?>" onClick="return confirm('Are you sure you want to delete this referrer?');">delete</a></p> </div></td><?php } } } } ?> </tr>
-
This is what I have - if (mysql_query($sql)) { } else { ?> <p class="text">Error: <?php echo(mysql_error()); ?></p> <?php } } else { ?> <p class="text">Error: You have not selected a document to upload.</p> <?php } } ?> this is what I get, even though the items are uploading correctly - Error: You have not selected a document to upload. Can anybody help? I'm new to this =p Thanks, Nubsauce.
-
[SOLVED] Variable is blank, how to substitute?
PHP Nubsauce replied to PHP Nubsauce's topic in PHP Coding Help
Thanks alot, this worked well. Appriciated. -
[SOLVED] Variable is blank, how to substitute?
PHP Nubsauce replied to PHP Nubsauce's topic in PHP Coding Help
Ok, I was at work, forgive me, I could not copy and paste my code. $username = $_SESSION['loggedin']; $firstname = $t['first_name']; $lastname = $t['last_name']; $addedby = $firstname. " " .$lastname; This all works fine. All I'd like to do is replace "addedby" with "username" if both firstname and lastname are blank. Thanks for your patience. -
[SOLVED] Variable is blank, how to substitute?
PHP Nubsauce replied to PHP Nubsauce's topic in PHP Coding Help
i have $username = user_name $firstname = first_name $lastname = last_name addedby = $firstname' . '$lastname Yeah, sorry i was unclear, If firstname and lastname are both blank, I'd like addedby to be username. Thanks. -
Hi, I have $username = user_name $firstname = first_name $lastname = last_name addedby = $firstname' . '$lastname How can I make it so if firstname and lastname are blank, it uses username instead? Any help would be appriciated! Thanks, Nubsauce.