FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Multiple <a> Tags, Filled With MySQL DB data with PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Multiple <a> Tags, Filled With MySQL DB data with PHP [message #179237 is a reply to message #179232] Tue, 25 September 2012 19:16 Go to previous messageGo to previous message
tom.rankin51 is currently offline  tom.rankin51
Messages: 17
Registered: September 2012
Karma:
Junior Member
I'm way ahead of you. My code is exactly the same regardless of whether I use the PHP or the HTML. My error logs contain absolutely nothing so it doesn't appear to be posting any errors at all.

I honestly thought the above was the bare minimum :-)

I'm pretty exasperated now though with it because it appears I've done everything right?
Tom

On Tuesday, September 25, 2012 7:41:38 PM UTC+1, Denis McMahon wrote:
> On Tue, 25 Sep 2012 10:43:45 -0700, tom.rankin51 wrote:
>
>
>
>> I am trying to create two image galleries using fancybox. There is no
>
>> issue doing this by manually typing out a bunch of <a> tags with the
>
>> info inside, but when I attempt to code a piece of PHP to pull this data
>
>> from my database, it doesn't like it and displays the images strangely.
>
>
>
> Basic troubleshooting for php / mysql / html stuff:
>
>
>
> 1) Turn all the warnings on in php
>
> 2) Make sure that every database call tests for errors, and that they get
>
> reported
>
> 2a) In extreme cases, output the actual sql query and var_dump the result:
>
>
>
> I do something like this at the top of my code in such situations:
>
>
>
> <?php
>
>
>
> $debugtxt = "";
>
> $debugging = false;
>
> if ( $_SERVER['REMOTE_ADDR'] == $my_ip && $_GET['debug'] == "37" )
>
> $debugging = true;
>
>
>
> ?>
>
>
>
> and wrap something like this round every sql call:
>
>
>
> <?php
>
>
>
> $sql = ".......";
>
>
>
> $result = mysqli->query( $sql );
>
>
>
> $debugtxt .= "sql call to get date of last login from users table\n";
>
> $debugtxt .= "sql: {$sql}\n";
>
> $debugtxt .= "Result:" . var_dump( $result );
>
>
>
> if ( $result === false ) {
>
> ..... do onething
>
> }
>
> else {
>
> ..... do otherthing
>
> }
>
>
>
> ?>
>
>
>
> When you generate the html, before the closing </body> tag:
>
>
>
> <?php if ( $debugging ) echo "<hr><h1>Debugging</h1><pre>$debugtxt</pre>
>
> \n"; ?>
>
>
>
> 3) check the server error logs after each request
>
> 4) view the html source of the pages you get so you can see the actual
>
> html that your page is generating
>
> 5) When posting to the group, pare your code down to the minimum that
>
> demonstrates the problem.
>
>
>
> You will hopefully then be able to determine where your code is going
>
> wrong and why.
>
>
>
> In this particular case, I would suggest (4) is particularly important,
>
> you have told us what you expect, and what code you use to generate it,
>
> but have not shown us what the generated html looks like when examined
>
> with the source viewer in your browser.
>
>
>
> If no html is generated, go back to the server logs looking for a php
>
> reported error. If your sql query is failing, your sql result set is
>
> actually the value false, and you're failing to detect this. There may be
>
> an sql error message in your server logs.
>
>
>
> Rgds
>
>
>
> Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamic Links (MySQL/PHP)
Next Topic: Advice for Literature on PHP-Based Web Development Business Models
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 03:37:00 GMT 2024

Total time taken to generate the page: 0.04168 seconds