Jump to content

daniish

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daniish's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks that seems to have worked. No errors occur and my Google Map displays, however, none of the data from the MySQL database is visible but thats probably a separate issue.
  2. I too have used XAMPP, but changing the software is not an option here because this database is on my host web server (Fast Hosting Direct). Does anyone have any alternative suggestions. Many thanks
  3. The phpMyAdmin link suggests that i replace 'localhost' for 127.0.0.1 to resolve this issue, which i did and got the following error: Parse error: syntax error, unexpected T_DNUMBER in /home/sites/globexposure.net/public_html/includes/dbinfo.php on line 2 My include dbinfo.php looks like this: <?php $link = mysql_connect(127.0.0.1,username,password) or die("Could not connect: " . mysql_error()); mysql_select_db('database name') or die ("Can\'t use dbmapserver : " . mysql_error()); ?> Incidentally my username and database name are the same but this shouldn't cause any problems. What would you suggest?
  4. Hello, I am trying to return a set of results from a query on my database, but i get the following error message: Warning: mysql_connect() [function.mysql-connect]: Access denied for user '0'@'localhost' (using password: YES) in /home/sites/globexposure.net/public_html/includes/dbinfo.php on line 2 Could not connect: Access denied for user '0'@'localhost' (using password: YES) I suspect this means that i have not assigned the proper user privileges but i'm not sure how to check this through phpMyAdmin. Can anyone confirm this/know a solution? Many thanks
  5. Hello, How do i set (the target for) a URL link that i have on my website to open in an iFrame that i have on the same webpage? Presumably i need to add some kind of anchor in the iFrame but i'm not really sure. Many thanks Olly
  6. I have re-phrased this and asked it elsewhere where i got a solution. Please ignore this post.
  7. Essentially within Google API i don't understand how to parse the 'id' of the label to retrieve relevant fields from my database for display in the iFrame. As a workaround i would like to store a url which references the specific record 'id' within a field in my database. I know how to get the contents of this field to display in my Google Maps label, which will provide the necessary link without understanding the above. For this to work i need my initial form (add_poi_form.php) to collect this information as a hidden variable and i can use your code to work out what the MAX(id) is - but i need MAX(id) +1 I think this would be done in the following sort of way but i'm really not sure: [code] <form name="add_blog" action="insert_poi.php" method="post"> <?php $res = mysql_query("SELECT MAX(id) FROM locations") or die(mysql_error()); $max_id = mysql_result ($res, 0, 0); $info_id = $max_id ++1; ?> <INPUT TYPE=hidden ID=info_id NAME=info_id VALUE="<a href='http://www.globexposure.net/more_info.html?id=$info_id'>More info...</a>" /> [/code] Hopefully i haven't confused the situation and i'm sorry my question is so convoluted but i would appreciate your clarity. Thanks Olly
  8. Many thanks Barand thats very helpful. If i could trouble you for one last point: On my current form which adds my input to the MySQL database, if i wanted to include a short snippet of php to store the link in a field within the database...am i on the right path: [code] <form name="add_blog" action="insert_poi.php" method="post"> <?php $res = mysql_query("SELECT MAX(id) FROM locations") or die(mysql_error()); $max_id = mysql_result ($res, 0, 0); $new_id = $max_id ++1; ?> <INPUT TYPE=hidden ID=info_id NAME=info_id VALUE="<a href='http://www.globexposure.net/more_info.html?id=$new_id'>More info...</a>" /> [/code] insert_poi.php looks like this: [code] <?php $link = mysql_connect("a", "b", "c"); if (!$link)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db("d", $link); $sql="INSERT INTO locations (title, date, description, lat, lon, link, marker, info_id) VALUES ('$_POST[title]','$_POST[date]','$_POST[description]','$_POST[lat]','$_POST[lon]','$_POST[link]','$_POST[itype]','$_POST[info_id]')"; if (!mysql_query($sql,$link))   {   die('Error: ' . mysql_error());   } echo "1 record added "; echo "<a href='http://www.globexposure.net/form_index.html'>Back to Form Index</a>"; mysql_close($link) ?> [/code] Again thank you.
  9. Only i have access to add records to this database...so i can always check the database to confirm what the latest record id is. I would like to have an html temlate (that uses php) to display the data entered on the form from the MySQL database using something like: echo $row['title']; echo $row['date']; echo $row['description']; where the 'id' from the form = the 'id' in the MySQL table (these would be the same). I already use auto_increment id in the table. I am using Google Maps to display points i visit and i have form to enter details of these on the move. I need the link to put in the Marker label so that users can select this link (which i hope to have open in an iFrame i have on the same page) to get more information. I hope you can help Barand!
  10. Hello, I have a form where i would like to send a hidden variable. The value of the variable is a URL to display the input from the form. The input from the form is stored as a record in a MySQL database. I am using the following code: Code: <INPUT TYPE=hidden NAME=info_id VALUE="http://www.globexposure.net/more_info.html> My question is: How do i append the MySQL record 'id' to the URL so that it returns the relevant information?  (I know the 'id' would be equal to the last 'id' in the database +1 but don't know how to code that) Many thanks Olly
  11. Evening! I have a form where i would like to send a hidden variable. The value of this variable is a URL to an html template displaying much of the information entered in the form. The info from the form is stored as a record in a MySQL database. I am using the following code but i'm not sure its right. [code] <INPUT TYPE=hidden NAME=info_id VALUE="http://www.globexposure.net/more_info.html?marker_id=" . $row['id'] . > [/code] The URL needs to include the MySQL 'id' for the record but i don't know how to parse the id to the form before the form is submitted. I hope you understand me and can help. Many thanks Olly
  12. Hmm i like arrays:) do you think i can get your method to work with the javascript i am using: [url=http://www.javascriptkit.com/script/script2/curdateform2.shtml]http://www.javascriptkit.com/script/script2/curdateform2.shtml[/url] Cheers!
  13. Hello, I have the following date selector in an html form: [code] <form name=add_blog action="insert.php" method="post"> Title: <br><input type="text" size="79" id="title" method="post" name="title"></input> <br><br> Date: <br> <select id="daydropdown"></select> <select id="monthdropdown"></select> <select id="yeardropdown"></select> <br><br> [/code] How do i concatenate the DATE values and save them in a variable that i can assign to a field in my SQL database? Many thanks for your help
×
×
  • 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.