I Need Help With A Php Program - Programming (2) - Nairaland
Nairaland Forum › Science/Technology › Programming › I Need Help With A Php Program (3941 Views)
| Re: I Need Help With A Php Program by zillonnair(op): 4:06pm On Apr 07, 2010 |
well this time, i think i succeeded in posting everything |
| Re: I Need Help With A Php Program by sayhi2ay(m): 4:08pm On Apr 07, 2010 |
why dont you just simply use $sql = 'select * from listings_categories where pk = "$pk" '; rather than escaping the character or $sql = "select * from listings_categories where pk = '$pk' "; also, your first fetch array doesnt have a while or foreach statement to actually grab the array elements |
| Re: I Need Help With A Php Program by lojik(m): 4:14pm On Apr 07, 2010 |
I had a display problem when i upgraded to xampp 1.7.2 and i figured out that php short opening tags were causing my problem i.e <? instead of <?php i suggest you change all your short opening tags i.e <? to normal php tags i.e <?php . That solved my problem after 3 days of troubleshooting without getting any display errors. |
| Re: I Need Help With A Php Program by zillonnair(op): 4:17pm On Apr 07, 2010 |
Hi, thanks all for your support but like i mentioned, i inherited this code, i dont even no jack on PHP, i am originally a PL/SQL programmer, i am just stuck with this one. The code used to work well until recently when i noticed that it works and fails, meaning, at some point, records are updated on the database and it reflects on the table website, and at other times, database is updated but it doesnt reflect on the database. I feel the only way you can really solve this issue for me, is for me to expose to these files and links. |
| Re: I Need Help With A Php Program by sayhi2ay(m): 4:21pm On Apr 07, 2010 |
i can not see the whole code, could you do a screen copy and post as an image? i think the spam bot caught the whole code you posted. CRUD implementation shouldnt really be giving so much error, since you have few queries going on there |
| Re: I Need Help With A Php Program by dellnet: 4:30pm On Apr 07, 2010 |
lets try this
|
| Re: I Need Help With A Php Program by zillonnair(op): 4:34pm On Apr 07, 2010 |
guys please give me an email let me forward the file to u This is a site with huge traffic and my boss is on my case. |
| Re: I Need Help With A Php Program by dellnet: 4:34pm On Apr 07, 2010 |
this is site need some serious tuning. |
| Re: I Need Help With A Php Program by dellnet: 4:35pm On Apr 07, 2010 |
I corrected some things I want to post back but I cant. |
| Re: I Need Help With A Php Program by dellnet: 4:36pm On Apr 07, 2010 |
[php] <?php include ("include/db_connect.php" ;include ("include/path.php" ;$pk = $_GET['pk']; $sql = "select * from listings_categories where pk = \"$pk\""; $sql_result = mysql_query($sql, $connection) or die("Query 1 failed : " . mysql_error()); $row = mysql_fetch_array($sql_result, MYSQL_BOTH); $title = $row["title"]; $title_uc = strtoupper($title); $meta_title = $row["meta_title"]; $meta_description = $row["meta_description"]; $meta_keywords = $row["meta_keywords"]; $topad1 = $row["topad1"]; if ($topad1 == "" $topad1 = "bansplit.gif";$topad1_url = $row["topad1_url"]; $topad2 = $row["topad2"]; if ($topad2 == "" $topad2 = "bansplit.gif";$topad2_url = $row["topad2_url"]; $bottomad1 = $row["bottomad1"]; if ($bottomad1 == "" $bottomad1 = "bansplit.gif";$bottomad1_url = $row["bottomad1_url"]; $bottomad2 = $row["bottomad2"]; if ($bottomad2 == "" $bottomad2 = "bansplit.gif";$bottomad2_url = $row["bottomad2_url"]; $leftad1 = $row["leftad1"]; if ($leftad1 == "" $leftad1 = "advertc.gif";$leftad1_url = $row["leftad1_url"]; $leftad2 = $row["leftad2"]; if ($leftad2 == "" $leftad2 = "bannerb.jpg";$leftad2_url = $row["leftad2_url"]; $rightad1 = $row["rightad1"]; if ($rightad1 == "" $rightad1 = "advert.jpg";$rightad1_url = $row["rightad1_url"]; $rightad2 = $row["rightad2"]; if ($rightad2 == "" $rightad2 = "advert.jpg";$rightad2_url = $row["rightad2_url"]; $rightad3 = $row["rightad3"]; if ($rightad3 == "" $rightad3 = "advert.jpg";$rightad3_url = $row["rightad3_url"]; $rightad4 = $row["rightad4"]; if ($rightad4 == "" $rightad4 = "advert.jpg";$rightad4_url = $row["rightad4_url"]; $rightad5 = $row["rightad5"]; if ($rightad5 == "" $rightad5 = "advert.jpg";$rightad5_url = $row["rightad5_url"]; $rightad6 = $row["rightad6"]; if ($rightad6 == "" $rightad6 = "advert.jpg";$rightad6_url = $row["rightad6_url"]; $headerad1 = $row["headerad1"]; if ($headerad1 == "" $headerad1 = "advertpic.gif";$headerad1_url = $row["headerad1_url"]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="menu.js"></script> <LINK HREF="default.css" TYPE="text/css" REL="stylesheet"> <title><?php echo $meta_title?></title> <META NAME="TITLE" CONTENT="<?php echo $meta_title?>"> <META NAME="DESCRIPTION" CONTENT="<?php echo $meta_description?>"> <META NAME="KEYWORDS" CONTENT="<?php echo $meta_keywords?>"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellpadding="0" cellspacing="-1" background="images/topbg1.jpg"> <tr> <td height="134"> </td> <td width="559" valign="top" background="images/top2bg.jpg"><div align="right"><span class="logo"><img src="topimage.jpg" width="559" height="80" border="0" alt="" /></span></div> <div align="right"></div></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="-1"> <tr> <td width="160" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td><div align="center"> <?php if ($leftad1_url <> "" {?> <a href="<?php echo $leftad1_url?>"> <?php } ?> <img src="listings/<?php echo $leftad1?>" alt="" border="0" /> <?php if ($leftad1_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td> <?php include ("menu.php" ;?> </td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php if ($leftad2_url <> "" {?> <a href="<?php echo $leftad2_url?>"> <?php } ?> <img src="listings/<?php echo $leftad2?>" alt="" border="0" /> <?php if ($leftad2_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td><table width="300" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td><div align="center"> <?php if ($topad1_url <> "" {?> <a href="<?php echo $topad1_url?>"> <?php } ?> <img src="listings/<?php echo $topad1?>" alt="" border="0" /> <?php if ($topad1_url <> "" {?> </a> <?php } ?> </div></td> <td><div align="center"> <?php if ($topad2_url <> "" {?> <a href="<?php echo $topad2_url?>"> <?php } ?> <img src="listings/<?php echo $topad2?>" alt="" border="0" /> <?php if ($topad2_url <> "" {?> </a> <?php } ?> </div></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="-1"> <tr> <td width="76%" valign="top"><h1><?php echo $title_uc?></h1></td> <td width="24%"><div align="center"> <?php if ($headerad1_url <> "" {?> <a href="<?php echo $headerad1_url?>"> <?php } ?> <img src="listings/<?php echo $headerad1?>" alt="" border="0" /> <?php if ($headerad1_url <> "" {?> </a> <?php } ?> </div></td> </tr> </table></td> </tr> <tr> <td> <?php $sql = "select * from listings_areas"; $sql_result = mysql_query($sql, $connection) or die("Query 1 failed : " . mysql_error()); while ($row = mysql_fetch_array($sql_result, MYSQL_BOTH)) { $area_id = $row["area_id"]; $area_name = $row["area_name"]; ?> <?php //body listings start here ?> <h2><?php echo $area_name?></h2><br> <?php $sql1 = "select * from listings, listings_2_categories where listings.dr_area = \"$area_id\" and listings_2_categories.listing_id = listings.dr_id and listings_2_categories.catid = \"$pk\" order by dr_name " ; //echo "$sql1<br>"; $sql_result1 = mysql_query($sql1, $connection) or die("Query 1 failed : " . mysql_error()); while ($row1 = mysql_fetch_array($sql_result1, MYSQL_BOTH)) { $dr_title = $row1["dr_title"]; $dr_name = $row1["dr_name"]; $dr_business = $row1["dr_business"]; $dr_address = nl2br(trim($row1["dr_address"])); $dr_telnum = $row1["dr_telnum"]; $dr_faxnum = $row1["dr_faxnum"]; $dr_cellnum = $row1["dr_cellnum"]; $dr_ahnum = $row1["dr_ahnum"]; $dr_email = $row1["dr_email"]; $dr_website = $row1["dr_website"]; $dr_officehours = nl2br(rtrim($row1["dr_officehours"])); $dr_notes = nl2br(trim($row1["dr_notes"])); $dr_focus = nl2br(trim($row1["dr_focus"])); $dr_logo = $row1["dr_logo"]; $dr_qualification = $row1["dr_qualification"]; ?> <?php if ($dr_telnum == "" { ?><table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#000000"> <tr> <td width="12%" bordercolor="#FFFFFF"> </td> <td width="88%" valign="top" bordercolor="#FFFFFF"> <?php if ($dr_logo <> "" {?> <div align="center"><img src="listings/<?php echo $dr_logo?>" /></div> <?php } ?> </td> </tr> </table> <?php } else { ?> <table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#000000"> <tr> <td width="80%" bordercolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="23%"><strong>Name:</strong></td> <td width="77%"><strong><?php echo $dr_title?> <?php echo $dr_name?> <?php if ($dr_business <> "" echo " :: $dr_business";?><?php if ($dr_qualification <> "" {?> <?php echo $dr_qualification?> <?php } ?> </strong></td> </tr> <?php if ($dr_address <> "" {?> <tr> <td valign="top">Address:</td> <td><?php echo $dr_address?></td> </tr> <?php } if ($dr_telnum <> "" {?> <tr> <td>Telephone:</td> <td><?php echo $dr_telnum?></td> </tr> <?php } if ($dr_faxnum <> "" {?> <tr> <td>Fax:</td> <td><?php echo $dr_faxnum?></td> </tr> <?php } if ($dr_cellnum <> "" {?> <tr> <td>Cellphone:</td> <td><?php echo $dr_cellnum?></td> </tr> <?php } if ($dr_ahnum <> "" {?> <tr> <td>After Hours No:</td> <td><?php echo $dr_ahnum?></td> </tr> <?php } if ($dr_email <> "" {?> <tr> <td>E-mail:</td> <td><a href="mailto:<?php echo $dr_email?>"><?php echo $dr_email?></a></td> </tr> <?php } if ($dr_website <> "" {?> <tr> <td>Website:</td> <td><?php echo $dr_website?></td> </tr> <?php } if ($dr_officehours <> "" {?> <tr> <td valign="top">Office Hours:</td> <td><?php echo $dr_officehours?></td> </tr> <?php } if ($dr_notes <> "" {?> <tr> <td valign="top">Notes / Special Features:</td> <td><?php echo $dr_notes?></td> </tr> <?php } if ($dr_focus <> "" {?> <tr> <td valign="top">Focus Areas:</td> <td><?php echo $dr_focus?></td> </tr> <?php } ?> </table></td> <td width="20%" valign="top" bordercolor="#FFFFFF"> <?php if ($dr_logo <> "" {?> <div align="center"><img src="listings/<?php echo $dr_logo?>" /></div> <?php } ?> </td> </tr> </table> <?php } ?> <?php //body listings ends here ?> <br> <?php } } ?> </td> </tr> <tr> <td><table width="300" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td><div align="center"> <?php if ($bottomad1_url <> "" {?> <a href="<?php echo $bottomad1_url?>"> <?php } ?> <img src="listings/<?php echo $bottomad1?>" alt="" border="0" /> <?php if ($bottomad1_url <> "" {?> </a> <?php } ?> </div></td> <td><div align="center"> <?php if ($bottomad2_url <> "" {?> <a href="<?php echo $bottomad2_url?>"> <?php } ?> <img src="listings/<?php echo $bottomad2?>" alt="" border="0" /> <?php if ($bottomad2_url <> "" {?> </a> <?php } ?> </div></td> </tr> </table></td> </tr> </table> </td> <td width="160" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td><div align="center"> <?php if ($rightad1_url <> "" {?> <a href="<?php echo $rightad1_url?>"> <?php } ?> <img src="listings/<?php echo $rightad1?>" alt="" border="0" /> <?php if ($rightad1_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php if ($rightad2_url <> "" {?> <a href="<?php echo $rightad2_url?>"> <?php } ?> <img src="listings/<?php echo $rightad2?>" alt="" border="0" /> <?php if ($rightad2_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php if ($rightad3_url <> "" {?> <a href="<?php echo $rightad3_url?>"> <?php } ?> <img src="listings/<?php echo $rightad3?>" alt="" border="0" /> <?php if ($rightad3_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php if ($rightad4_url <> "" {?> <a href="<?php echo $rightad4_url?>"> <?php } ?> <img src="listings/<?php echo $rightad4?>" alt="" border="0" /> <?php if ($rightad4_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php if ($rightad5_url <> "" {?> <a href="<?php echo $rightad1_ur5?>"> <?php } ?> <img src="listings/<?php echo $rightad5?>" alt="" border="0" /> <?php if ($rightad5_url <> "" {?> </a> <?php } ?> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"> <?php ?> <a href="<?php echo $rightad6_url?>"> <?php ?> <img src="listings/<?php echo $rightad6?>" alt="" border="0" /> <?php ?> </a> <?php ?> </div></td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table> <table width="700" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> <div class="center"> <p class="foot">Note: Dear users, prescribing medications online or giving a diagnosis contradicts medical ethics, which is why Doctors Online can only offer General information's and advise you on what medical professional to consult.</p> </div> </td> </tr> </table> <?php include("footertext.php" ;?> </body> [/php] |
| Re: I Need Help With A Php Program by dellnet: 4:37pm On Apr 07, 2010 |
there we go |
| Re: I Need Help With A Php Program by sayhi2ay(m): 4:38pm On Apr 07, 2010 |
@dell_net, nothing is posted o |
| Re: I Need Help With A Php Program by dellnet: 4:39pm On Apr 07, 2010 |
I am sending it your box. damn |
| Re: I Need Help With A Php Program by dellnet: 4:40pm On Apr 07, 2010 |
ay it disappeared |
| Re: I Need Help With A Php Program by sayhi2ay(m): 4:43pm On Apr 07, 2010 |
darn! guess we cant help him then , maybe he can find some other forums that allow him post the code, and we will take it from there |
| Re: I Need Help With A Php Program by dellnet: 4:45pm On Apr 07, 2010 |
I sent it to your box zillonnair. @ moderators if you are the one blocking our post then you need to check your policy again. we are doing this for educational purpose so that the next person having such problem could easily find help. 9ja all the way. |
| Re: I Need Help With A Php Program by zillonnair(op): 5:03pm On Apr 07, 2010 |
@dell-net I saw it and i am really delighted that you could go all the way to help a brother out. I trully appreciate. Thanks |
| Re: I Need Help With A Php Program by dellnet: 5:10pm On Apr 07, 2010 |
I think somewhere from line 449 the problem starts you might want to go through from there and check the variables being returned. Let me know how it works out. I will be on later. |
| Re: I Need Help With A Php Program by dellnet: 10:56pm On Apr 07, 2010 |
a fucking bot ai? |
| Re: I Need Help With A Php Program by zillonnair(op): 8:49am On Apr 08, 2010 |
i had created a forum and pasted the link here, i even spaced it and still it was removed. Thats not fair, u wont allow codes on a programming section and u want let them post links with spaces. |
| Re: I Need Help With A Php Program by dellnet: 10:14am On Apr 08, 2010 |
zillonnair were you able to get the script to work? |
| Re: I Need Help With A Php Program by zillonnair(op): 10:26am On Apr 08, 2010 |
not yet bruv, still have the same challenge, |
| Re: I Need Help With A Php Program by dellnet: 10:34am On Apr 08, 2010 |
you need to check with the database if those field contain values. How about the last one I sent? it should echo the first 2 columns of each row. If you can create a temporary login for me to your mysql server I can check from here using the script. |
| Re: I Need Help With A Php Program by zillonnair(op): 10:42am On Apr 08, 2010 |
i couldnt get it to work. i can forward u the cpanel details where you will have the files and the database and see the challenge i cam trying to represent. http:// www. askthedoctoronline.co.za/listing_13_hypnotherapists. html on the above link, (remove spaces), scroll down and u will see a white space between two records under Gauteng, that white space represent records that were added but not showing. They are added to the database but not echoed. |
| Re: I Need Help With A Php Program by dellnet: 10:59am On Apr 08, 2010 |
I can see a space before Sheryl van der Hoef's table. email me the cp details let me take a look at it. |
| Re: I Need Help With A Php Program by zillonnair(op): 11:06am On Apr 08, 2010 |
Exactly, that space is my headache. I would send you an email |
| Re: I Need Help With A Php Program by dellnet: 12:28pm On Apr 08, 2010 |
it is ok now. the problem is from the telephone number if the telephone number is empty the script will not output and just continue with the while loop. As you can see in the table Romi's number is empty. I included a snippet at line 489 you can change the string "N/A" to an approtiate value. |
| Re: I Need Help With A Php Program by zillonnair(op): 4:25pm On Apr 08, 2010 |
wow, i cant thank you enough, you are too much bro. I really really appreciate this, wow, thank you very much. I am indebted to you bro. Thank you once more |
How To Program A PHP SMS Gateway • What Is The Average Salary Of A Php Programmer In Lagos • I Need Help With A PHP Script • 2 • 3 • 4
MATLAB: The Language Of Technical Computing • Try This Algorithm Question. • UPDATED: Third Person 3D Game Developed In Unity3d
;