Jump to content

cljones81

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cljones81's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I wish to sincerely thank colombian and AndyB for their patience and kind help to an idiot who was having a major off day. Once again thank you Christian
  2. Thank you for the reply, Im a bit confused, maybe its the affect of a long day finally catching up on me but could you please explain more fully: here is my code: while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $id = $row["id"]; $description = $row["description"]; $category = $row["category"]; $dateuploaded = $row["dateuploaded"]; $url = $row['link']; $uploader = $row["uploaderid"]; $compurl = "<a href='$url'><img src='$url' alt='Click me for a larger image' width='80' height='81' border='0' /></a>"; $texturl = "<a href='$url' target='_blank'>Larger Image</a>"; echo "<table width='382' border='1' bordercolor='#F8F0F8' bgcolor='#0000FF' class='whiteonbluelink'> <tr> <th colspan='2' scope='col'><div align='left' class='style3'>$id $url uploaded by $uploader on the $dateuploaded </div></th> </tr> <tr> <td width='93'><span class='style5'>$compurl<br> $texturl</span></td> <td width='273'><span class='style5'>$description</span></td> </tr> <tr> <td colspan='2'><div align='center' class='style5'>Category: $category </div></td> </tr> </table> <br>"; } How could I incorporate your code into $compurl so that the javascript close window link is in the same window as the newly opened image. Sorry for my ignorance but didnt someone once say that the path to wisdom starts with the words I dont know, maybe it was me. Thank you again Christian
  3. Hi I have written a simple php script that outputs a thumbnail version of pics with information from a mysql database which when the user clicks the smaller image, a larger image is opened in a new window. My problem is I would like to have an automatically generated button below the bigger image that returns the viewer back to the previous page of thumbnail images. Could someone please help me as I haven't the first clue how to do this and cannot find any tutorials. Thank you in advance Christian
  4. Hello: I wonder if some could help me with this problem: I've created this form to construct their own fairly advanced dynamic queries using field names, keywords, query expressions AND, OR. Everything is fine if the user constructs the largest query size available e.g. Select * from table where fieldname1 = keyword1 AND fieldname2 = keyword2 OR fieldname3 = keyword3 AND fieldname4 = keyword4. The problem comes when you try and create a shorter query even with the unused fields set to their null values, the error, mysql_num_rows(): supplied argument is not a valid MySQL result resource appears. My question is this is there any way that you could get it to ignore the empty fields and just construct and process a query based on the fields filled in using php?
  5. Hi: I am currently working on coding a very simple search engine and I am quite frankly stumped, my question is this is it possible for a page to be looped or referred back to itself, after it has send a processing request to the server, with the results of that processing displayed in a field. The reason why I ask this because I want my users to select a table and that tables fields be returned from the server and be inserted into 1 or more list boxes which I can do, thanks to some kind people and one in particular on this self same forum but cannot work out how to send the results of a request from the server to the originating page and have them display on that page. Hopefully with this information, my users will be able to construct there own queries, for instance, if they selected the member table- it may look like SELECT * from member WHERE id = 12345 AND JoinDate = 12/12/08 which would then be resubmitted to the server and the results be displayed on a separate page, again which I can do. But a have come to a gap in my php knowledge in this particular area. So if some kind soul could fill in that gap, I would be most grateful. Christian
  6. That solved it, thank you, you dont know how much of a relief it is to get that sorted
  7. Hi Everyone: I am currently writing a simple search engine script and I've written this query: ("SELECT * FROM photo WHERE id LIKE '%'.$searchid.'%' OR description LIKE '%'.$searchid.'%' OR category LIKE '%'.$searchid.'%' ORDER BY id") Which returns this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in..... But it works if I remove the wildcards but as might be expected will only return exact matches which is very limited and not what is wanted, it is my understanding that the '%'.$searchid.'%' will either return results that start or and end or contain the variable searchid. So after many hours of torment by computer, I am just about ready to throw, said computer out of the window so if a kind soul could point out where this idiot is going wrong, it will very much appreciated. Christian
  8. Hi Everyone: I was just wondering if it would be possible to pass variables between forms on the same page, for instance, if I were to select a table from a listbox/combobox would it then be possible for this information to be passed to the next form on the same page, which would have a listbox/combobox which will contain the field names of the previously selected table, code which I have already written thanks helpful respondents on a previous posting of mine. I just think this would be a fair neater way than using buttons to pass variable between forms but I've not quite worked out how to do it and cannot find any suitable tutorials that deal with this, just passing variables between pages. So if anybody knows of any tutorials and have the URL to hand or can provide any helpful hint how to accomplish this, it will be appreciated. Christian
  9. Thank you to wildteen88 that was exactly what I was missing and so obvious when I think about it and also a big thank you to Cytech, for pointing me in the right direction in the first place
  10. Hi I've been playing around with my code and I came up with this: echo "Table '$dbname' in database '$database'"; for ($index=0; $index < $number_fields; ++$index) { $fields = mysql_field_name ($result, $index); } echo "<body text='#0033FF'> <form name='form1' method='post' action=''> <label> <select name='select'> <option value='$fields'>$fields</option> <option value='$fields'>$fields</option> <option value='$fields'>$fields</option> </select> </label> </form>"; Which will return the last element in the array and print it out as options, I tried this believing that it would print out the first element in the array $field[0], but instead it only printed out the first character, in the last element of the array. My apologises, this may seem like a rather simple question, but my programming is a tad rusty but is there anyway, I can access and print out the first element and so on in the array. Thank you
  11. Thank you for the reply, further too this, I have managed to echo out the field names of the selected database using this code: $result = mysql_list_fields($database, $dbtable); $number_fields = mysql_num_fields ($result); if (!$result){ echo "not result"; return false; } echo "Table '$dbname' in database '$database'"; for ($index=0; $index < $number_fields; ++$index) { echo mysql_field_name ($result, $index); } I have tried many ways of getting this information into a listbox for further selection by the user and none of them worked so please help me. Once again thank you
  12. Hi Everyone: I hope someone, can help me with this problem as its got me baffled: What I am trying to create is a MySQL database administration page where the user will select a database from a combo box and the next combo box will be automatically populated with the field ids for that database e.g. Username and Password and not the associated data that each column contains. The user will then enter the search criteria based on the selected item e.g. Username = Paul. This information will be stored into a variable contained within an SQL query e.g. $result = "select * from $dbname where $fieldid = $searchid"; which will be called as part of a PHP script when the submit button is clicked. All of this I can do I just cannot think of how to get the combo box to be automatically populated with the field ids and not the associate contents ??? Any help would be greatly appreciated.
×
×
  • 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.