Jump to content

Recommended Posts

I wrote the code below to access tables that my Drupal installation created to insert information into a custom php page.  Specifically it links pictures to a data type pulled from Druapl and makes them all nice.  It was working just dandy before, but then 1and1 hosting decided they wanted to overcharge me and then make my site setup unavailable.  I got over that quickly, got a new host, and now on the new host the code below is not working.  The table is set up like this:

 

table.JPG

 

What is happening is that the code pulls up the information from the same picture, and it will not put the correct number of images (as you can see in the picture, 3 images but on the report only 2 show).  The image is posts is only for the image with "delta" of 0.  Please assist!  Thanks in advance.

 

 <?php
$result = mysql_query("SELECT * FROM files where nid='$CR'") or die(mysql_error());
$tot=count($result);
$num=0;
while ( $tot >= $num ) {
$question= mysql_query("SELECT * FROM content_field_uphoto where nid='$CR' and delta=$num") or die(mysql_error());
$pic= mysql_fetch_array($question);
$url = $pic['field_uphoto_alt'] ;
print ("<a href='http://curseoftime.com/GRS/drupal/files/$url'><img src='http://curseoftime.com/GRS/drupal/files/$url' height=150 width=150></a>       ");
$num++;
}
?> 

 

Link to comment
https://forums.phpfreaks.com/topic/70184-problems-after-moving-server/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.