Jump to content

matty84

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

matty84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, i was wondering if is was possible to terminate a php command when it reaches a certain number. Basically I am searching an access database over odbc and I want to limit the results to 200. I have a count going on in php and i was wondering if there was a way to tell php to stop pulling in results when the count reaches 200? Any ideas? matt
  2. Hi I know you can autoredirect using php with a header function of some description but what about if you want to auto redirerct after running code? Is this possible? Basically I am using php to generate an XML file, then, when this file is made, I want the page to automatically redirect to this new file, cheers! Matt
  3. anyone?...
  4. Hi I have used php to search a database and return the results as an XML document. I was wondering what the php code is to insert a schema and stylesheet into the XML document that is generated by using DOM...any ideas? Also does anyone know how to run the DOM on the server so that the output combines the xml and stylesheet and returns valid xhtml? Cheers! Matt
  5. That generates the correct number of tags for the results but does not populate them...I assumed that  'salary' in [code]$doc->createTextNode( $employee['salary'] ) [/code] would relate to the table field by that name but that doesnt seem to work, any ideas? matt
  6. Hi I am interested in how the code below could be altered so that instead of creating the XML from array data, the xml is created from database information. Any suggestions? [code] <?php   $employees = array();   $employees [] = array(   'name' => 'Albert',   'age' => '34',   'salary' => "$10000"   );   $employees [] = array(   'name' => 'Claud',   'age' => '20',   'salary' => "$2000"   );     $doc = new DOMDocument();   $doc->formatOutput = true;     $r = $doc->createElement( "employees" );   $doc->appendChild( $r );     foreach( $employees as $employee )   {   $b = $doc->createElement( "employee" );     $name = $doc->createElement( "name" );   $name->appendChild(   $doc->createTextNode( $employee['name'] )   );   $b->appendChild( $name );     $age = $doc->createElement( "age" );   $age->appendChild(   $doc->createTextNode( $employee['age'] )   );   $b->appendChild( $age );     $salary = $doc->createElement( "salary" );   $salary->appendChild(   $doc->createTextNode( $employee['salary'] )   );   $b->appendChild( $salary );     $r->appendChild( $b );   }     echo $doc->saveXML();   $doc->save("write.xml")   ?> [/code]
  7. I am aware of PHP_SELF - I was wondering if there was a way to reuse the information from a GET command...for example if you want a link on your page that repeats the current url (e.g....http://.../info.php?name=matt -unlikely I know but if you wanted this how would it be done?
  8. perfect!!! Thankyou so much
  9. ignore the [/url] :)
  10. Hi, I am tryingo to create a link to an image in a database using php. the following code works when the images do not have spaces: echo "<td><a href=dbimages/$photo target=new>$photo</a></td>"; but some images are labelled 1223 - 2323.jpg for example (with spaces). When viewing the page the link for these images coes out like :http://.../1223 is there a way to tell php to include the spaces but make them %20 or something?? Matt
  11. I have an ODBC database and am trying to return pages results. problem is there is no LIMIT command for access. I have used the following to limit the results: $row_num = 0; while (odbc_fetch_row($rs)) { $row_num+=1; if ($row_num>0 and $row_num<51) { However it has been suggested there is now a way to either use an array or something else to allow me to put in next and previous links to show the next 50 results and so on until there are no more results. I, however, do not know how to do this - any suggestions? Matt
  12. Hi, Many thanks Sonia. As I am a noobie I cannot PM people, could you possible PM me? I do have a unique ID - my only concern is that if a serach is done and there are no results with unique ID 55-60 then will any results be shown? I really wish I wasnt using an MS database but the woman I am doing this project for updates in Access and wants the db kept that way (its a university project). Thanks Matt.
  13. Many thanks for your help. However when I try and implement the code I get an SQL error I think it is because ACCESS does not recognise LIMIT as an SQL command. Is there a way around this? Matt
  14. Sonia, i am rather a beginning and what you just said makes a lot of sense and to be honest is obvious really! I have gone through and begun removing redundant code....there's rather a lot!!! Thanks for helping out with the pagination  :) Matt
  15. It is an Access Database that I connect through ODBC System DSN Matt
×
×
  • 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.